Annotation of embedaddon/php/ext/standard/tests/math/hexdec_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test hexdec() - basic function test hexdec()
3: --SKIPIF--
4: <?php
5: if (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);
27: for ($i = 0; $i < count($values); $i++) {
28: $res = hexdec($values[$i]);
29: var_dump($res);
30: }
31: ?>
32: --EXPECTF--
33: int(18433668)
34: int(126895953)
35: float(142929835591)
36: float(142929835592)
37: int(1194684)
38: int(7904751)
39: int(2147483647)
40: float(2147483648)
41: int(1194684)
42: int(3215381)
43: int(3215381)
44: int(3215379)
45: int(51446064)
46: int(18279)
47: int(70199)
48: int(1)
49: int(0)
50: int(0)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>