1--TEST--
2Test octdec function : 64bit long tests
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6?>
7--FILE--
8<?php
9
10define("MAX_64Bit", 9223372036854775807);
11define("MAX_32Bit", 2147483647);
12define("MIN_64Bit", -9223372036854775807 - 1);
13define("MIN_32Bit", -2147483647 - 1);
14
15$octLongStrs = array(
16   '777777777777777777777',
17   '1777777777777777777777',
18   '17777777777',
19   '37777777777',
20   '377777777777777777777777',
21   '17777777777777777777777777',
22   '377777777777',
23   '777777777777',
24);
25
26
27foreach ($octLongStrs as $strVal) {
28   echo "--- testing: $strVal ---\n";
29   var_dump(octdec($strVal));
30}
31
32?>
33--EXPECT--
34--- testing: 777777777777777777777 ---
35int(9223372036854775807)
36--- testing: 1777777777777777777777 ---
37float(1.8446744073709552E+19)
38--- testing: 17777777777 ---
39int(2147483647)
40--- testing: 37777777777 ---
41int(4294967295)
42--- testing: 377777777777777777777777 ---
43float(2.3611832414348226E+21)
44--- testing: 17777777777777777777777777 ---
45float(7.555786372591432E+22)
46--- testing: 377777777777 ---
47int(34359738367)
48--- testing: 777777777777 ---
49int(68719476735)
50