Annotation of embedaddon/php/tests/lang/operators/negate_variationStr.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test -N operator : various numbers as strings
! 3: --FILE--
! 4: <?php
! 5:
! 6: $strVals = array(
! 7: "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
! 8: "a5.9"
! 9: );
! 10:
! 11:
! 12: foreach ($strVals as $strVal) {
! 13: echo "--- testing: '$strVal' ---\n";
! 14: var_dump(-$strVal);
! 15: }
! 16:
! 17: ?>
! 18: ===DONE===
! 19: --EXPECT--
! 20: --- testing: '0' ---
! 21: int(0)
! 22: --- testing: '65' ---
! 23: int(-65)
! 24: --- testing: '-44' ---
! 25: int(44)
! 26: --- testing: '1.2' ---
! 27: float(-1.2)
! 28: --- testing: '-7.7' ---
! 29: float(7.7)
! 30: --- testing: 'abc' ---
! 31: int(0)
! 32: --- testing: '123abc' ---
! 33: int(-123)
! 34: --- testing: '123e5' ---
! 35: float(-12300000)
! 36: --- testing: '123e5xyz' ---
! 37: float(-12300000)
! 38: --- testing: ' 123abc' ---
! 39: int(-123)
! 40: --- testing: '123 abc' ---
! 41: int(-123)
! 42: --- testing: '123abc ' ---
! 43: int(-123)
! 44: --- testing: '3.4a' ---
! 45: float(-3.4)
! 46: --- testing: 'a5.9' ---
! 47: int(0)
! 48: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>