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 null); 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) 41int(1194684) 42int(3215381) 43int(3215381) 44int(3215379) 45int(51446064) 46int(18279) 47int(70199) 48int(1) 49int(0) 50int(0) 51