1--TEST-- 2Test hexdec function : 64bit long tests 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); 6?> 7--FILE-- 8<?php 9 10define("MAX_64Bit", 9223372036854775807); 11define("MAX_32Bit", 2147483647); 12define("MIN_64Bit", -9223372036854775807 - 1); 13define("MIN_32Bit", -2147483647 - 1); 14 15$hexLongStrs = array( 16 '7'.str_repeat('f',15), 17 str_repeat('f',16), 18 '7'.str_repeat('f',7), 19 str_repeat('f',8), 20 '7'.str_repeat('f',16), 21 str_repeat('f',18), 22 '7'.str_repeat('f',8), 23 str_repeat('f',9) 24); 25 26 27foreach ($hexLongStrs as $strVal) { 28 echo "--- testing: $strVal ---\n"; 29 var_dump(hexdec($strVal)); 30} 31 32?> 33===DONE=== 34--EXPECT-- 35--- testing: 7fffffffffffffff --- 36int(9223372036854775807) 37--- testing: ffffffffffffffff --- 38float(1.844674407371E+19) 39--- testing: 7fffffff --- 40int(2147483647) 41--- testing: ffffffff --- 42int(4294967295) 43--- testing: 7ffffffffffffffff --- 44float(1.4757395258968E+20) 45--- testing: ffffffffffffffffff --- 46float(4.7223664828696E+21) 47--- testing: 7ffffffff --- 48int(34359738367) 49--- testing: fffffffff --- 50int(68719476735) 51===DONE=== 52