1--TEST--
2Octal integer strings (64bit)
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6?>
7--FILE--
8<?php
9/* Using octal prefix notation lowercase */
10/* Maximum value representable as integer */
11$octal = 0o777777777777777777777;
12var_dump($octal);
13var_dump(PHP_INT_MAX);
14
15/* *technically* this should work but treat this as a degenerate case */
16$octal = 0o1000000000000000000000;
17var_dump($octal);
18
19/* Floating number */
20$octal = 0o45734321536435450000000000;
21var_dump($octal);
22
23/* Integer */
24$octal = 0o16;
25var_dump($octal);
26
27/* underscore separator */
28$octal = 0o1_6;
29var_dump($octal);
30
31/* Ignore leading 0 and _ */
32$octal = 0o0_016;
33var_dump($octal);
34$octal = 0o0_16;
35var_dump($octal);
36
37/* Overflow to infinity */
38$octal = 0o77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
39var_dump($octal);
40
41/* Using octal prefix notation uppercase */
42/* Maximum value representable as integer */
43$octal = 0O777777777777777777777;
44var_dump($octal);
45var_dump(PHP_INT_MAX);
46
47/* *technically* this should work but treat this as a degenerate case */
48$octal = 0O1000000000000000000000;
49var_dump($octal);
50
51/* Floating number */
52$octal = 0O45734321536435450000000000;
53var_dump($octal);
54
55/* Integer */
56$octal = 0O16;
57var_dump($octal);
58
59/* underscore separator */
60$octal = 0O1_6;
61var_dump($octal);
62
63/* Ignore leading 0 and _ */
64$octal = 0O0_016;
65var_dump($octal);
66$octal = 0O0_16;
67var_dump($octal);
68
69/* Overflow to infinity */
70$octal = 0O77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
71var_dump($octal);
72
73/* Using no dedicated prefix */
74/* Maximum value representable as integer */
75$octal = 0777777777777777777777;
76var_dump($octal);
77var_dump(PHP_INT_MAX);
78
79/* *technically* this should work but treat this as a degenerate case */
80$octal = 01000000000000000000000;
81var_dump($octal);
82
83/* Floating number */
84$octal = 045734321536435450000000000;
85var_dump($octal);
86
87/* Integer */
88$octal = 016;
89var_dump($octal);
90
91/* underscore separator */
92$octal = 01_6;
93var_dump($octal);
94
95/* Ignore leading 0 and _ */
96$octal = 00_016;
97var_dump($octal);
98$octal = 0_16;
99var_dump($octal);
100
101/* Overflow to infinity */
102$octal = 077777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
103var_dump($octal);
104
105?>
106--EXPECT--
107int(9223372036854775807)
108int(9223372036854775807)
109float(9.223372036854776E+18)
110float(1.7912166229916324E+23)
111int(14)
112int(14)
113int(14)
114int(14)
115float(INF)
116int(9223372036854775807)
117int(9223372036854775807)
118float(9.223372036854776E+18)
119float(1.7912166229916324E+23)
120int(14)
121int(14)
122int(14)
123int(14)
124float(INF)
125int(9223372036854775807)
126int(9223372036854775807)
127float(9.223372036854776E+18)
128float(1.7912166229916324E+23)
129int(14)
130int(14)
131int(14)
132int(14)
133float(INF)
134