3 define("MAX_64Bit", 9223372036854775807);
4 define("MAX_32Bit", 2147483647);
5 define("MIN_64Bit", -9223372036854775807 - 1);
6 define("MIN_32Bit", -2147483647 - 1);
8 $validLessThan = array (
9 2147483646, array(MAX_32Bit
, "2147483647", "2147483647.001", 2.147483647e9
, 2147483647.9),
10 MIN_32Bit
, array(MIN_32Bit +
1, "-2147483647", "-2147483646.001", -2.1474836461e9
, -2147483646.9),
13 $invalidLessThan = array (
14 MAX_32Bit
, array("2147483646", 2.1474836460001e9
, MAX_32Bit
- 1),
15 MIN_32Bit
, array(MIN_32Bit
- 1, "-2147483649", -2.1474836480001e9
)
20 for ($i = 0; $i < count($validLessThan); $i +
=2) {
21 $typeToTestVal = $validLessThan[$i];
22 $compares = $validLessThan[$i +
1];
23 foreach($compares as $compareVal) {
24 if ($typeToTestVal < $compareVal) {
28 echo "FAILED: '$typeToTestVal' >= '$compareVal'\n";
33 // test for invalid values
34 for ($i = 0; $i < count($invalidLessThan); $i +
=2) {
35 $typeToTestVal = $invalidLessThan[$i];
36 $compares = $invalidLessThan[$i +
1];
37 foreach($compares as $compareVal) {
38 if ($typeToTestVal < $compareVal) {
39 echo "FAILED: '$typeToTestVal' < '$compareVal'\n";
45 if ($failed == false) {