diff options
Diffstat (limited to 'tests/lang/operators/operator_spaceship_basic.phpt')
-rw-r--r-- | tests/lang/operators/operator_spaceship_basic.phpt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/lang/operators/operator_spaceship_basic.phpt b/tests/lang/operators/operator_spaceship_basic.phpt index 81b0516757..13b80612dc 100644 --- a/tests/lang/operators/operator_spaceship_basic.phpt +++ b/tests/lang/operators/operator_spaceship_basic.phpt @@ -24,19 +24,19 @@ $toCompare = array( // boolean test will result in both sides being converted to boolean so !0 = true and true is not > true for example // also note that a string of "0" is converted to false but a string of "0.0" is converted to true // false cannot be tested as 0 can never be > 0 or 1 - true, $valid_false, $valid_true, + true, $valid_false, $valid_true, $int1, $valid_int1, $invalid_int1, $int2, $valid_int2, $invalid_int2, $float1, $valid_float1, $invalid_float1, $float2, $valid_float2, $invalid_float2 ); - + $failed = false; for ($i = 0; $i < count($toCompare); $i +=3) { $typeToTest = $toCompare[$i]; $valid_compares = $toCompare[$i + 1]; $invalid_compares = $toCompare[$i + 2]; - + foreach($valid_compares as $compareVal) { if (($typeToTest <=> $compareVal) === 1) { // do nothing @@ -60,7 +60,7 @@ for ($i = 0; $i < count($toCompare); $i +=3) { $failed = true; } } - + foreach($invalid_compares as $compareVal) { if (($typeToTest <=> $compareVal) === 1) { echo "FAILED: ('$typeToTest' <=> '$compareVal') === 1\n"; @@ -75,7 +75,7 @@ for ($i = 0; $i < count($toCompare); $i +=3) { $failed = true; } } - + if (($typeToTest <=> $typeToTest) === 0) { // do nothing } |