Return to octdec_basiclong_64bit.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / math |
1.1 misho 1: --TEST-- 2: Test octdec function : 64bit long tests 3: --SKIPIF-- 4: <?php 5: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); 6: ?> 7: --FILE-- 8: <?php 9: 10: define("MAX_64Bit", 9223372036854775807); 11: define("MAX_32Bit", 2147483647); 12: define("MIN_64Bit", -9223372036854775807 - 1); 13: define("MIN_32Bit", -2147483647 - 1); 14: 15: $octLongStrs = array( 16: '777777777777777777777', 17: '1777777777777777777777', 18: '17777777777', 19: '37777777777', 20: '377777777777777777777777', 21: '17777777777777777777777777', 22: '377777777777', 23: '777777777777', 24: ); 25: 26: 27: foreach ($octLongStrs as $strVal) { 28: echo "--- testing: $strVal ---\n"; 29: var_dump(octdec($strVal)); 30: } 31: 32: ?> 33: ===DONE=== 34: --EXPECT-- 35: --- testing: 777777777777777777777 --- 36: int(9223372036854775807) 37: --- testing: 1777777777777777777777 --- 38: float(1.844674407371E+19) 39: --- testing: 17777777777 --- 40: int(2147483647) 41: --- testing: 37777777777 --- 42: int(4294967295) 43: --- testing: 377777777777777777777777 --- 44: float(2.3611832414348E+21) 45: --- testing: 17777777777777777777777777 --- 46: float(7.5557863725914E+22) 47: --- testing: 377777777777 --- 48: int(34359738367) 49: --- testing: 777777777777 --- 50: int(68719476735) 51: ===DONE===