1--TEST--
2Hexadecimal integer strings (32bit)
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
6?>
7--FILE--
8<?php
9/* Using hexadecimal prefix notation lowercase */
10/* Maximum value representable as integer */
11$hex = 0x7FFFFFFF;
12var_dump($hex);
13var_dump(PHP_INT_MAX);
14
15/* Floating number */
16$hex = 0x45FFFABCDE0000000;
17var_dump($hex);
18
19/* Integer */
20$hex = 0x1C;
21var_dump($hex);
22
23/* underscore separator */
24$hex = 0x1_C;
25var_dump($hex);
26
27/* Ignore leading 0 and _ */
28$hex = 0x0_01C;
29var_dump($hex);
30$hex = 0x0_1C;
31var_dump($hex);
32
33/* Overflow to infinity */
34$hex = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
35var_dump($hex);
36
37/* Using hexadecimal prefix notation uppercase */
38/* Maximum value representable as integer */
39$hex = 0X7FFFFFFF;
40var_dump($hex);
41var_dump(PHP_INT_MAX);
42
43/* Floating number */
44$hex = 0X45FFFABCDE0000000;
45var_dump($hex);
46
47/* Integer */
48$hex = 0X1C;
49var_dump($hex);
50
51/* underscore separator */
52$hex = 0X1_C;
53var_dump($hex);
54
55/* Ignore leading 0 and _ */
56$hex = 0X0_01C;
57var_dump($hex);
58$hex = 0X0_1C;
59var_dump($hex);
60
61/* Overflow to infinity */
62$hex = 0XFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
63var_dump($hex);
64
65?>
66--EXPECT--
67int(2147483647)
68int(2147483647)
69float(8.070441274821732E+19)
70int(28)
71int(28)
72int(28)
73int(28)
74float(INF)
75int(2147483647)
76int(2147483647)
77float(8.070441274821732E+19)
78int(28)
79int(28)
80int(28)
81int(28)
82float(INF)
83