1--TEST-- 2Test hexdec() - basic function test hexdec() 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); 6?> 7--FILE-- 8<?php 9$values = array(0x123abc, 10 0x789DEF, 11 0x7FFFFFFF, 12 0x80000000, 13 '0x123abc', 14 '0x789DEF', 15 '0x7FFFFFFF', 16 '0x80000000', 17 '0x123XYZABC', 18 311015, 19 '311015', 20 31101.3, 21 31.1013e5, 22 011237, 23 '011237', 24 true, 25 false, 26 ); 27for ($i = 0; $i < count($values); $i++) { 28 $res = hexdec($values[$i]); 29 var_dump($res); 30} 31?> 32--EXPECTF-- 33int(18433668) 34int(126895953) 35float(142929835591) 36float(142929835592) 37int(1194684) 38int(7904751) 39int(2147483647) 40float(2147483648) 41 42Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 43int(1194684) 44int(3215381) 45int(3215381) 46 47Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 48int(3215379) 49int(51446064) 50int(18279) 51int(70199) 52int(1) 53int(0) 54