Revert "Fixed last previously broken tests"

This reverts commit 79b1832dd5.
This commit is contained in:
Dmitry Stogov 2015-06-29 13:05:14 +03:00
parent 642c379092
commit 0b35e4a3be
7 changed files with 1382 additions and 1096 deletions

View File

@ -9,12 +9,12 @@ $b = array();
try {
$c = $a % $b;
var_dump($c);
} catch (Error $e) {
echo "Error: " . $e->getMessage() . "\n";
} catch (Exception $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
echo "Done\n";
?>
--EXPECTF--
Error: Modulo by zero
Exception: Division by zero
Done

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,14 @@ Test / operator : various numbers as strings
--FILE--
<?php
$strVals = ["65","-44", "1.2", "-7.7", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a"];
$strVals = array(
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
"a5.9"
);
foreach (array_merge(["0", "abc"], $strVals) as $strVal) {
error_reporting(E_ERROR);
foreach ($strVals as $strVal) {
foreach($strVals as $otherVal) {
echo "--- testing: '$strVal' / '$otherVal' ---\n";
var_dump($strVal/$otherVal);
@ -16,290 +21,396 @@ foreach (array_merge(["0", "abc"], $strVals) as $strVal) {
?>
===DONE===
--EXPECT--
--- testing: '0' / '65' ---
int(0)
--- testing: '0' / '-44' ---
int(0)
--- testing: '0' / '1.2' ---
float(0)
--- testing: '0' / '-7.7' ---
float(-0)
--- testing: '0' / '123abc' ---
int(0)
--- testing: '0' / '123e5' ---
float(0)
--- testing: '0' / '123e5xyz' ---
float(0)
--- testing: '0' / ' 123abc' ---
int(0)
--- testing: '0' / '123 abc' ---
int(0)
--- testing: '0' / '123abc ' ---
int(0)
--- testing: '0' / '3.4a' ---
float(0)
--- testing: 'abc' / '65' ---
int(0)
--- testing: 'abc' / '-44' ---
int(0)
--- testing: 'abc' / '1.2' ---
float(0)
--- testing: 'abc' / '-7.7' ---
float(-0)
--- testing: 'abc' / '123abc' ---
int(0)
--- testing: 'abc' / '123e5' ---
float(0)
--- testing: 'abc' / '123e5xyz' ---
float(0)
--- testing: 'abc' / ' 123abc' ---
int(0)
--- testing: 'abc' / '123 abc' ---
int(0)
--- testing: 'abc' / '123abc ' ---
int(0)
--- testing: 'abc' / '3.4a' ---
float(0)
--- testing: '65' / '65' ---
int(1)
--- testing: '65' / '-44' ---
float(-1.4772727272727)
--- testing: '65' / '1.2' ---
float(54.166666666667)
--- testing: '65' / '-7.7' ---
float(-8.4415584415584)
--- testing: '65' / '123abc' ---
float(0.52845528455285)
--- testing: '65' / '123e5' ---
float(5.2845528455285E-6)
--- testing: '65' / '123e5xyz' ---
float(5.2845528455285E-6)
--- testing: '65' / ' 123abc' ---
float(0.52845528455285)
--- testing: '65' / '123 abc' ---
float(0.52845528455285)
--- testing: '65' / '123abc ' ---
float(0.52845528455285)
--- testing: '65' / '3.4a' ---
float(19.117647058824)
--- testing: '-44' / '65' ---
float(-0.67692307692308)
--- testing: '-44' / '-44' ---
int(1)
--- testing: '-44' / '1.2' ---
float(-36.666666666667)
--- testing: '-44' / '-7.7' ---
float(5.7142857142857)
--- testing: '-44' / '123abc' ---
float(-0.35772357723577)
--- testing: '-44' / '123e5' ---
float(-3.5772357723577E-6)
--- testing: '-44' / '123e5xyz' ---
float(-3.5772357723577E-6)
--- testing: '-44' / ' 123abc' ---
float(-0.35772357723577)
--- testing: '-44' / '123 abc' ---
float(-0.35772357723577)
--- testing: '-44' / '123abc ' ---
float(-0.35772357723577)
--- testing: '-44' / '3.4a' ---
float(-12.941176470588)
--- testing: '1.2' / '65' ---
float(0.018461538461538)
--- testing: '1.2' / '-44' ---
float(-0.027272727272727)
--- testing: '1.2' / '1.2' ---
float(1)
--- testing: '1.2' / '-7.7' ---
float(-0.15584415584416)
--- testing: '1.2' / '123abc' ---
float(0.0097560975609756)
--- testing: '1.2' / '123e5' ---
float(9.7560975609756E-8)
--- testing: '1.2' / '123e5xyz' ---
float(9.7560975609756E-8)
--- testing: '1.2' / ' 123abc' ---
float(0.0097560975609756)
--- testing: '1.2' / '123 abc' ---
float(0.0097560975609756)
--- testing: '1.2' / '123abc ' ---
float(0.0097560975609756)
--- testing: '1.2' / '3.4a' ---
float(0.35294117647059)
--- testing: '-7.7' / '65' ---
float(-0.11846153846154)
--- testing: '-7.7' / '-44' ---
float(0.175)
--- testing: '-7.7' / '1.2' ---
float(-6.4166666666667)
--- testing: '-7.7' / '-7.7' ---
float(1)
--- testing: '-7.7' / '123abc' ---
float(-0.06260162601626)
--- testing: '-7.7' / '123e5' ---
float(-6.260162601626E-7)
--- testing: '-7.7' / '123e5xyz' ---
float(-6.260162601626E-7)
--- testing: '-7.7' / ' 123abc' ---
float(-0.06260162601626)
--- testing: '-7.7' / '123 abc' ---
float(-0.06260162601626)
--- testing: '-7.7' / '123abc ' ---
float(-0.06260162601626)
--- testing: '-7.7' / '3.4a' ---
float(-2.2647058823529)
--- testing: '123abc' / '65' ---
float(1.8923076923077)
--- testing: '123abc' / '-44' ---
float(-2.7954545454545)
--- testing: '123abc' / '1.2' ---
float(102.5)
--- testing: '123abc' / '-7.7' ---
float(-15.974025974026)
--- testing: '123abc' / '123abc' ---
int(1)
--- testing: '123abc' / '123e5' ---
float(1.0E-5)
--- testing: '123abc' / '123e5xyz' ---
float(1.0E-5)
--- testing: '123abc' / ' 123abc' ---
int(1)
--- testing: '123abc' / '123 abc' ---
int(1)
--- testing: '123abc' / '123abc ' ---
int(1)
--- testing: '123abc' / '3.4a' ---
float(36.176470588235)
--- testing: '123e5' / '65' ---
float(189230.76923077)
--- testing: '123e5' / '-44' ---
float(-279545.45454545)
--- testing: '123e5' / '1.2' ---
float(10250000)
--- testing: '123e5' / '-7.7' ---
float(-1597402.5974026)
--- testing: '123e5' / '123abc' ---
float(100000)
--- testing: '123e5' / '123e5' ---
float(1)
--- testing: '123e5' / '123e5xyz' ---
float(1)
--- testing: '123e5' / ' 123abc' ---
float(100000)
--- testing: '123e5' / '123 abc' ---
float(100000)
--- testing: '123e5' / '123abc ' ---
float(100000)
--- testing: '123e5' / '3.4a' ---
float(3617647.0588235)
--- testing: '123e5xyz' / '65' ---
float(189230.76923077)
--- testing: '123e5xyz' / '-44' ---
float(-279545.45454545)
--- testing: '123e5xyz' / '1.2' ---
float(10250000)
--- testing: '123e5xyz' / '-7.7' ---
float(-1597402.5974026)
--- testing: '123e5xyz' / '123abc' ---
float(100000)
--- testing: '123e5xyz' / '123e5' ---
float(1)
--- testing: '123e5xyz' / '123e5xyz' ---
float(1)
--- testing: '123e5xyz' / ' 123abc' ---
float(100000)
--- testing: '123e5xyz' / '123 abc' ---
float(100000)
--- testing: '123e5xyz' / '123abc ' ---
float(100000)
--- testing: '123e5xyz' / '3.4a' ---
float(3617647.0588235)
--- testing: ' 123abc' / '65' ---
float(1.8923076923077)
--- testing: ' 123abc' / '-44' ---
float(-2.7954545454545)
--- testing: ' 123abc' / '1.2' ---
float(102.5)
--- testing: ' 123abc' / '-7.7' ---
float(-15.974025974026)
--- testing: ' 123abc' / '123abc' ---
int(1)
--- testing: ' 123abc' / '123e5' ---
float(1.0E-5)
--- testing: ' 123abc' / '123e5xyz' ---
float(1.0E-5)
--- testing: ' 123abc' / ' 123abc' ---
int(1)
--- testing: ' 123abc' / '123 abc' ---
int(1)
--- testing: ' 123abc' / '123abc ' ---
int(1)
--- testing: ' 123abc' / '3.4a' ---
float(36.176470588235)
--- testing: '123 abc' / '65' ---
float(1.8923076923077)
--- testing: '123 abc' / '-44' ---
float(-2.7954545454545)
--- testing: '123 abc' / '1.2' ---
float(102.5)
--- testing: '123 abc' / '-7.7' ---
float(-15.974025974026)
--- testing: '123 abc' / '123abc' ---
int(1)
--- testing: '123 abc' / '123e5' ---
float(1.0E-5)
--- testing: '123 abc' / '123e5xyz' ---
float(1.0E-5)
--- testing: '123 abc' / ' 123abc' ---
int(1)
--- testing: '123 abc' / '123 abc' ---
int(1)
--- testing: '123 abc' / '123abc ' ---
int(1)
--- testing: '123 abc' / '3.4a' ---
float(36.176470588235)
--- testing: '123abc ' / '65' ---
float(1.8923076923077)
--- testing: '123abc ' / '-44' ---
float(-2.7954545454545)
--- testing: '123abc ' / '1.2' ---
float(102.5)
--- testing: '123abc ' / '-7.7' ---
float(-15.974025974026)
--- testing: '123abc ' / '123abc' ---
int(1)
--- testing: '123abc ' / '123e5' ---
float(1.0E-5)
--- testing: '123abc ' / '123e5xyz' ---
float(1.0E-5)
--- testing: '123abc ' / ' 123abc' ---
int(1)
--- testing: '123abc ' / '123 abc' ---
int(1)
--- testing: '123abc ' / '123abc ' ---
int(1)
--- testing: '123abc ' / '3.4a' ---
float(36.176470588235)
--- testing: '3.4a' / '65' ---
float(0.052307692307692)
--- testing: '3.4a' / '-44' ---
float(-0.077272727272727)
--- testing: '3.4a' / '1.2' ---
float(2.8333333333333)
--- testing: '3.4a' / '-7.7' ---
float(-0.44155844155844)
--- testing: '3.4a' / '123abc' ---
float(0.027642276422764)
--- testing: '3.4a' / '123e5' ---
float(2.7642276422764E-7)
--- testing: '3.4a' / '123e5xyz' ---
float(2.7642276422764E-7)
--- testing: '3.4a' / ' 123abc' ---
float(0.027642276422764)
--- testing: '3.4a' / '123 abc' ---
float(0.027642276422764)
--- testing: '3.4a' / '123abc ' ---
float(0.027642276422764)
--- testing: '3.4a' / '3.4a' ---
float(1)
--- testing: '0' / '0' ---
float(NAN)
--- testing: '0' / '65' ---
int(0)
--- testing: '0' / '-44' ---
int(0)
--- testing: '0' / '1.2' ---
float(0)
--- testing: '0' / '-7.7' ---
float(-0)
--- testing: '0' / 'abc' ---
float(NAN)
--- testing: '0' / '123abc' ---
int(0)
--- testing: '0' / '123e5' ---
float(0)
--- testing: '0' / '123e5xyz' ---
float(0)
--- testing: '0' / ' 123abc' ---
int(0)
--- testing: '0' / '123 abc' ---
int(0)
--- testing: '0' / '123abc ' ---
int(0)
--- testing: '0' / '3.4a' ---
float(0)
--- testing: '0' / 'a5.9' ---
float(NAN)
--- testing: '65' / '0' ---
float(INF)
--- testing: '65' / '65' ---
int(1)
--- testing: '65' / '-44' ---
float(-1.4772727272727)
--- testing: '65' / '1.2' ---
float(54.166666666667)
--- testing: '65' / '-7.7' ---
float(-8.4415584415584)
--- testing: '65' / 'abc' ---
float(INF)
--- testing: '65' / '123abc' ---
float(0.52845528455285)
--- testing: '65' / '123e5' ---
float(5.2845528455285E-6)
--- testing: '65' / '123e5xyz' ---
float(5.2845528455285E-6)
--- testing: '65' / ' 123abc' ---
float(0.52845528455285)
--- testing: '65' / '123 abc' ---
float(0.52845528455285)
--- testing: '65' / '123abc ' ---
float(0.52845528455285)
--- testing: '65' / '3.4a' ---
float(19.117647058824)
--- testing: '65' / 'a5.9' ---
float(INF)
--- testing: '-44' / '0' ---
float(-INF)
--- testing: '-44' / '65' ---
float(-0.67692307692308)
--- testing: '-44' / '-44' ---
int(1)
--- testing: '-44' / '1.2' ---
float(-36.666666666667)
--- testing: '-44' / '-7.7' ---
float(5.7142857142857)
--- testing: '-44' / 'abc' ---
float(-INF)
--- testing: '-44' / '123abc' ---
float(-0.35772357723577)
--- testing: '-44' / '123e5' ---
float(-3.5772357723577E-6)
--- testing: '-44' / '123e5xyz' ---
float(-3.5772357723577E-6)
--- testing: '-44' / ' 123abc' ---
float(-0.35772357723577)
--- testing: '-44' / '123 abc' ---
float(-0.35772357723577)
--- testing: '-44' / '123abc ' ---
float(-0.35772357723577)
--- testing: '-44' / '3.4a' ---
float(-12.941176470588)
--- testing: '-44' / 'a5.9' ---
float(-INF)
--- testing: '1.2' / '0' ---
float(INF)
--- testing: '1.2' / '65' ---
float(0.018461538461538)
--- testing: '1.2' / '-44' ---
float(-0.027272727272727)
--- testing: '1.2' / '1.2' ---
float(1)
--- testing: '1.2' / '-7.7' ---
float(-0.15584415584416)
--- testing: '1.2' / 'abc' ---
float(INF)
--- testing: '1.2' / '123abc' ---
float(0.0097560975609756)
--- testing: '1.2' / '123e5' ---
float(9.7560975609756E-8)
--- testing: '1.2' / '123e5xyz' ---
float(9.7560975609756E-8)
--- testing: '1.2' / ' 123abc' ---
float(0.0097560975609756)
--- testing: '1.2' / '123 abc' ---
float(0.0097560975609756)
--- testing: '1.2' / '123abc ' ---
float(0.0097560975609756)
--- testing: '1.2' / '3.4a' ---
float(0.35294117647059)
--- testing: '1.2' / 'a5.9' ---
float(INF)
--- testing: '-7.7' / '0' ---
float(-INF)
--- testing: '-7.7' / '65' ---
float(-0.11846153846154)
--- testing: '-7.7' / '-44' ---
float(0.175)
--- testing: '-7.7' / '1.2' ---
float(-6.4166666666667)
--- testing: '-7.7' / '-7.7' ---
float(1)
--- testing: '-7.7' / 'abc' ---
float(-INF)
--- testing: '-7.7' / '123abc' ---
float(-0.06260162601626)
--- testing: '-7.7' / '123e5' ---
float(-6.260162601626E-7)
--- testing: '-7.7' / '123e5xyz' ---
float(-6.260162601626E-7)
--- testing: '-7.7' / ' 123abc' ---
float(-0.06260162601626)
--- testing: '-7.7' / '123 abc' ---
float(-0.06260162601626)
--- testing: '-7.7' / '123abc ' ---
float(-0.06260162601626)
--- testing: '-7.7' / '3.4a' ---
float(-2.2647058823529)
--- testing: '-7.7' / 'a5.9' ---
float(-INF)
--- testing: 'abc' / '0' ---
float(NAN)
--- testing: 'abc' / '65' ---
int(0)
--- testing: 'abc' / '-44' ---
int(0)
--- testing: 'abc' / '1.2' ---
float(0)
--- testing: 'abc' / '-7.7' ---
float(-0)
--- testing: 'abc' / 'abc' ---
float(NAN)
--- testing: 'abc' / '123abc' ---
int(0)
--- testing: 'abc' / '123e5' ---
float(0)
--- testing: 'abc' / '123e5xyz' ---
float(0)
--- testing: 'abc' / ' 123abc' ---
int(0)
--- testing: 'abc' / '123 abc' ---
int(0)
--- testing: 'abc' / '123abc ' ---
int(0)
--- testing: 'abc' / '3.4a' ---
float(0)
--- testing: 'abc' / 'a5.9' ---
float(NAN)
--- testing: '123abc' / '0' ---
float(INF)
--- testing: '123abc' / '65' ---
float(1.8923076923077)
--- testing: '123abc' / '-44' ---
float(-2.7954545454545)
--- testing: '123abc' / '1.2' ---
float(102.5)
--- testing: '123abc' / '-7.7' ---
float(-15.974025974026)
--- testing: '123abc' / 'abc' ---
float(INF)
--- testing: '123abc' / '123abc' ---
int(1)
--- testing: '123abc' / '123e5' ---
float(1.0E-5)
--- testing: '123abc' / '123e5xyz' ---
float(1.0E-5)
--- testing: '123abc' / ' 123abc' ---
int(1)
--- testing: '123abc' / '123 abc' ---
int(1)
--- testing: '123abc' / '123abc ' ---
int(1)
--- testing: '123abc' / '3.4a' ---
float(36.176470588235)
--- testing: '123abc' / 'a5.9' ---
float(INF)
--- testing: '123e5' / '0' ---
float(INF)
--- testing: '123e5' / '65' ---
float(189230.76923077)
--- testing: '123e5' / '-44' ---
float(-279545.45454545)
--- testing: '123e5' / '1.2' ---
float(10250000)
--- testing: '123e5' / '-7.7' ---
float(-1597402.5974026)
--- testing: '123e5' / 'abc' ---
float(INF)
--- testing: '123e5' / '123abc' ---
float(100000)
--- testing: '123e5' / '123e5' ---
float(1)
--- testing: '123e5' / '123e5xyz' ---
float(1)
--- testing: '123e5' / ' 123abc' ---
float(100000)
--- testing: '123e5' / '123 abc' ---
float(100000)
--- testing: '123e5' / '123abc ' ---
float(100000)
--- testing: '123e5' / '3.4a' ---
float(3617647.0588235)
--- testing: '123e5' / 'a5.9' ---
float(INF)
--- testing: '123e5xyz' / '0' ---
float(INF)
--- testing: '123e5xyz' / '65' ---
float(189230.76923077)
--- testing: '123e5xyz' / '-44' ---
float(-279545.45454545)
--- testing: '123e5xyz' / '1.2' ---
float(10250000)
--- testing: '123e5xyz' / '-7.7' ---
float(-1597402.5974026)
--- testing: '123e5xyz' / 'abc' ---
float(INF)
--- testing: '123e5xyz' / '123abc' ---
float(100000)
--- testing: '123e5xyz' / '123e5' ---
float(1)
--- testing: '123e5xyz' / '123e5xyz' ---
float(1)
--- testing: '123e5xyz' / ' 123abc' ---
float(100000)
--- testing: '123e5xyz' / '123 abc' ---
float(100000)
--- testing: '123e5xyz' / '123abc ' ---
float(100000)
--- testing: '123e5xyz' / '3.4a' ---
float(3617647.0588235)
--- testing: '123e5xyz' / 'a5.9' ---
float(INF)
--- testing: ' 123abc' / '0' ---
float(INF)
--- testing: ' 123abc' / '65' ---
float(1.8923076923077)
--- testing: ' 123abc' / '-44' ---
float(-2.7954545454545)
--- testing: ' 123abc' / '1.2' ---
float(102.5)
--- testing: ' 123abc' / '-7.7' ---
float(-15.974025974026)
--- testing: ' 123abc' / 'abc' ---
float(INF)
--- testing: ' 123abc' / '123abc' ---
int(1)
--- testing: ' 123abc' / '123e5' ---
float(1.0E-5)
--- testing: ' 123abc' / '123e5xyz' ---
float(1.0E-5)
--- testing: ' 123abc' / ' 123abc' ---
int(1)
--- testing: ' 123abc' / '123 abc' ---
int(1)
--- testing: ' 123abc' / '123abc ' ---
int(1)
--- testing: ' 123abc' / '3.4a' ---
float(36.176470588235)
--- testing: ' 123abc' / 'a5.9' ---
float(INF)
--- testing: '123 abc' / '0' ---
float(INF)
--- testing: '123 abc' / '65' ---
float(1.8923076923077)
--- testing: '123 abc' / '-44' ---
float(-2.7954545454545)
--- testing: '123 abc' / '1.2' ---
float(102.5)
--- testing: '123 abc' / '-7.7' ---
float(-15.974025974026)
--- testing: '123 abc' / 'abc' ---
float(INF)
--- testing: '123 abc' / '123abc' ---
int(1)
--- testing: '123 abc' / '123e5' ---
float(1.0E-5)
--- testing: '123 abc' / '123e5xyz' ---
float(1.0E-5)
--- testing: '123 abc' / ' 123abc' ---
int(1)
--- testing: '123 abc' / '123 abc' ---
int(1)
--- testing: '123 abc' / '123abc ' ---
int(1)
--- testing: '123 abc' / '3.4a' ---
float(36.176470588235)
--- testing: '123 abc' / 'a5.9' ---
float(INF)
--- testing: '123abc ' / '0' ---
float(INF)
--- testing: '123abc ' / '65' ---
float(1.8923076923077)
--- testing: '123abc ' / '-44' ---
float(-2.7954545454545)
--- testing: '123abc ' / '1.2' ---
float(102.5)
--- testing: '123abc ' / '-7.7' ---
float(-15.974025974026)
--- testing: '123abc ' / 'abc' ---
float(INF)
--- testing: '123abc ' / '123abc' ---
int(1)
--- testing: '123abc ' / '123e5' ---
float(1.0E-5)
--- testing: '123abc ' / '123e5xyz' ---
float(1.0E-5)
--- testing: '123abc ' / ' 123abc' ---
int(1)
--- testing: '123abc ' / '123 abc' ---
int(1)
--- testing: '123abc ' / '123abc ' ---
int(1)
--- testing: '123abc ' / '3.4a' ---
float(36.176470588235)
--- testing: '123abc ' / 'a5.9' ---
float(INF)
--- testing: '3.4a' / '0' ---
float(INF)
--- testing: '3.4a' / '65' ---
float(0.052307692307692)
--- testing: '3.4a' / '-44' ---
float(-0.077272727272727)
--- testing: '3.4a' / '1.2' ---
float(2.8333333333333)
--- testing: '3.4a' / '-7.7' ---
float(-0.44155844155844)
--- testing: '3.4a' / 'abc' ---
float(INF)
--- testing: '3.4a' / '123abc' ---
float(0.027642276422764)
--- testing: '3.4a' / '123e5' ---
float(2.7642276422764E-7)
--- testing: '3.4a' / '123e5xyz' ---
float(2.7642276422764E-7)
--- testing: '3.4a' / ' 123abc' ---
float(0.027642276422764)
--- testing: '3.4a' / '123 abc' ---
float(0.027642276422764)
--- testing: '3.4a' / '123abc ' ---
float(0.027642276422764)
--- testing: '3.4a' / '3.4a' ---
float(1)
--- testing: '3.4a' / 'a5.9' ---
float(INF)
--- testing: 'a5.9' / '0' ---
float(NAN)
--- testing: 'a5.9' / '65' ---
int(0)
--- testing: 'a5.9' / '-44' ---
int(0)
--- testing: 'a5.9' / '1.2' ---
float(0)
--- testing: 'a5.9' / '-7.7' ---
float(-0)
--- testing: 'a5.9' / 'abc' ---
float(NAN)
--- testing: 'a5.9' / '123abc' ---
int(0)
--- testing: 'a5.9' / '123e5' ---
float(0)
--- testing: 'a5.9' / '123e5xyz' ---
float(0)
--- testing: 'a5.9' / ' 123abc' ---
int(0)
--- testing: 'a5.9' / '123 abc' ---
int(0)
--- testing: 'a5.9' / '123abc ' ---
int(0)
--- testing: 'a5.9' / '3.4a' ---
float(0)
--- testing: 'a5.9' / 'a5.9' ---
float(NAN)
===DONE===

View File

@ -18,7 +18,9 @@ $longVals = array(
MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
);
$otherVals = array(1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
error_reporting(E_ERROR);
foreach ($longVals as $longVal) {
foreach($otherVals as $otherVal) {
@ -31,7 +33,7 @@ foreach ($longVals as $longVal) {
}
}
foreach (array_merge([0], $otherVals) as $otherVal) {
foreach ($otherVals as $otherVal) {
foreach($longVals as $longVal) {
echo "--- testing: $otherVal % $longVal ---\n";
try {
@ -45,6 +47,8 @@ foreach (array_merge([0], $otherVals) as $otherVal) {
?>
===DONE===
--EXPECT--
--- testing: 9223372036854775807 % 0 ---
Exception: Division by zero
--- testing: 9223372036854775807 % 1 ---
int(0)
--- testing: 9223372036854775807 % -1 ---
@ -61,6 +65,8 @@ int(7)
int(1)
--- testing: 9223372036854775807 % 9223372036854775807 ---
int(0)
--- testing: -9223372036854775808 % 0 ---
Exception: Division by zero
--- testing: -9223372036854775808 % 1 ---
int(0)
--- testing: -9223372036854775808 % -1 ---
@ -77,6 +83,8 @@ int(-8)
int(-2)
--- testing: -9223372036854775808 % 9223372036854775807 ---
int(-1)
--- testing: 2147483647 % 0 ---
Exception: Division by zero
--- testing: 2147483647 % 1 ---
int(0)
--- testing: 2147483647 % -1 ---
@ -93,6 +101,8 @@ int(23)
int(0)
--- testing: 2147483647 % 9223372036854775807 ---
int(2147483647)
--- testing: -2147483648 % 0 ---
Exception: Division by zero
--- testing: -2147483648 % 1 ---
int(0)
--- testing: -2147483648 % -1 ---
@ -109,6 +119,8 @@ int(-24)
int(-1)
--- testing: -2147483648 % 9223372036854775807 ---
int(-2147483648)
--- testing: 9223372034707292160 % 0 ---
Exception: Division by zero
--- testing: 9223372034707292160 % 1 ---
int(0)
--- testing: 9223372034707292160 % -1 ---
@ -125,6 +137,8 @@ int(28)
int(1)
--- testing: 9223372034707292160 % 9223372036854775807 ---
int(9223372034707292160)
--- testing: -9223372034707292160 % 0 ---
Exception: Division by zero
--- testing: -9223372034707292160 % 1 ---
int(0)
--- testing: -9223372034707292160 % -1 ---
@ -141,6 +155,8 @@ int(-28)
int(-1)
--- testing: -9223372034707292160 % 9223372036854775807 ---
int(-9223372034707292160)
--- testing: 2147483648 % 0 ---
Exception: Division by zero
--- testing: 2147483648 % 1 ---
int(0)
--- testing: 2147483648 % -1 ---
@ -157,6 +173,8 @@ int(24)
int(1)
--- testing: 2147483648 % 9223372036854775807 ---
int(2147483648)
--- testing: -2147483649 % 0 ---
Exception: Division by zero
--- testing: -2147483649 % 1 ---
int(0)
--- testing: -2147483649 % -1 ---
@ -173,6 +191,8 @@ int(-25)
int(-2)
--- testing: -2147483649 % 9223372036854775807 ---
int(-2147483649)
--- testing: 4294967294 % 0 ---
Exception: Division by zero
--- testing: 4294967294 % 1 ---
int(0)
--- testing: 4294967294 % -1 ---
@ -189,6 +209,8 @@ int(2)
int(0)
--- testing: 4294967294 % 9223372036854775807 ---
int(4294967294)
--- testing: 4294967295 % 0 ---
Exception: Division by zero
--- testing: 4294967295 % 1 ---
int(0)
--- testing: 4294967295 % -1 ---
@ -205,6 +227,8 @@ int(3)
int(1)
--- testing: 4294967295 % 9223372036854775807 ---
int(4294967295)
--- testing: 4294967293 % 0 ---
Exception: Division by zero
--- testing: 4294967293 % 1 ---
int(0)
--- testing: 4294967293 % -1 ---
@ -221,6 +245,8 @@ int(1)
int(2147483646)
--- testing: 4294967293 % 9223372036854775807 ---
int(4294967293)
--- testing: 9223372036854775806 % 0 ---
Exception: Division by zero
--- testing: 9223372036854775806 % 1 ---
int(0)
--- testing: 9223372036854775806 % -1 ---
@ -237,6 +263,8 @@ int(6)
int(0)
--- testing: 9223372036854775806 % 9223372036854775807 ---
int(9223372036854775806)
--- testing: 9.2233720368548E+18 % 0 ---
Exception: Division by zero
--- testing: 9.2233720368548E+18 % 1 ---
int(0)
--- testing: 9.2233720368548E+18 % -1 ---
@ -253,6 +281,8 @@ int(-8)
int(-2)
--- testing: 9.2233720368548E+18 % 9223372036854775807 ---
int(-1)
--- testing: -9223372036854775807 % 0 ---
Exception: Division by zero
--- testing: -9223372036854775807 % 1 ---
int(0)
--- testing: -9223372036854775807 % -1 ---
@ -269,6 +299,8 @@ int(-7)
int(-1)
--- testing: -9223372036854775807 % 9223372036854775807 ---
int(0)
--- testing: -9.2233720368548E+18 % 0 ---
Exception: Division by zero
--- testing: -9.2233720368548E+18 % 1 ---
int(0)
--- testing: -9.2233720368548E+18 % -1 ---

View File

@ -3,11 +3,14 @@ Test % operator : various numbers as strings
--FILE--
<?php
$strVals = ["65", "-44", "1.2", "-7.7", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a"];
$strVals = array(
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
"a5.9"
);
error_reporting(E_ERROR);
foreach (array_merge(["0", "abc"], $strVals) as $strVal) {
foreach ($strVals as $strVal) {
foreach($strVals as $otherVal) {
echo "--- testing: '$strVal' % '$otherVal' ---\n";
try {
@ -22,290 +25,396 @@ foreach (array_merge(["0", "abc"], $strVals) as $strVal) {
?>
===DONE===
--EXPECT--
--- testing: '0' % '65' ---
int(0)
--- testing: '0' % '-44' ---
int(0)
--- testing: '0' % '1.2' ---
int(0)
--- testing: '0' % '-7.7' ---
int(0)
--- testing: '0' % '123abc' ---
int(0)
--- testing: '0' % '123e5' ---
int(0)
--- testing: '0' % '123e5xyz' ---
int(0)
--- testing: '0' % ' 123abc' ---
int(0)
--- testing: '0' % '123 abc' ---
int(0)
--- testing: '0' % '123abc ' ---
int(0)
--- testing: '0' % '3.4a' ---
int(0)
--- testing: 'abc' % '65' ---
int(0)
--- testing: 'abc' % '-44' ---
int(0)
--- testing: 'abc' % '1.2' ---
int(0)
--- testing: 'abc' % '-7.7' ---
int(0)
--- testing: 'abc' % '123abc' ---
int(0)
--- testing: 'abc' % '123e5' ---
int(0)
--- testing: 'abc' % '123e5xyz' ---
int(0)
--- testing: 'abc' % ' 123abc' ---
int(0)
--- testing: 'abc' % '123 abc' ---
int(0)
--- testing: 'abc' % '123abc ' ---
int(0)
--- testing: 'abc' % '3.4a' ---
int(0)
--- testing: '65' % '65' ---
int(0)
--- testing: '65' % '-44' ---
int(21)
--- testing: '65' % '1.2' ---
int(0)
--- testing: '65' % '-7.7' ---
int(2)
--- testing: '65' % '123abc' ---
int(65)
--- testing: '65' % '123e5' ---
int(65)
--- testing: '65' % '123e5xyz' ---
int(65)
--- testing: '65' % ' 123abc' ---
int(65)
--- testing: '65' % '123 abc' ---
int(65)
--- testing: '65' % '123abc ' ---
int(65)
--- testing: '65' % '3.4a' ---
int(2)
--- testing: '-44' % '65' ---
int(-44)
--- testing: '-44' % '-44' ---
int(0)
--- testing: '-44' % '1.2' ---
int(0)
--- testing: '-44' % '-7.7' ---
int(-2)
--- testing: '-44' % '123abc' ---
int(-44)
--- testing: '-44' % '123e5' ---
int(-44)
--- testing: '-44' % '123e5xyz' ---
int(-44)
--- testing: '-44' % ' 123abc' ---
int(-44)
--- testing: '-44' % '123 abc' ---
int(-44)
--- testing: '-44' % '123abc ' ---
int(-44)
--- testing: '-44' % '3.4a' ---
int(-2)
--- testing: '1.2' % '65' ---
int(1)
--- testing: '1.2' % '-44' ---
int(1)
--- testing: '1.2' % '1.2' ---
int(0)
--- testing: '1.2' % '-7.7' ---
int(1)
--- testing: '1.2' % '123abc' ---
int(1)
--- testing: '1.2' % '123e5' ---
int(1)
--- testing: '1.2' % '123e5xyz' ---
int(1)
--- testing: '1.2' % ' 123abc' ---
int(1)
--- testing: '1.2' % '123 abc' ---
int(1)
--- testing: '1.2' % '123abc ' ---
int(1)
--- testing: '1.2' % '3.4a' ---
int(1)
--- testing: '-7.7' % '65' ---
int(-7)
--- testing: '-7.7' % '-44' ---
int(-7)
--- testing: '-7.7' % '1.2' ---
int(0)
--- testing: '-7.7' % '-7.7' ---
int(0)
--- testing: '-7.7' % '123abc' ---
int(-7)
--- testing: '-7.7' % '123e5' ---
int(-7)
--- testing: '-7.7' % '123e5xyz' ---
int(-7)
--- testing: '-7.7' % ' 123abc' ---
int(-7)
--- testing: '-7.7' % '123 abc' ---
int(-7)
--- testing: '-7.7' % '123abc ' ---
int(-7)
--- testing: '-7.7' % '3.4a' ---
int(-1)
--- testing: '123abc' % '65' ---
int(58)
--- testing: '123abc' % '-44' ---
int(35)
--- testing: '123abc' % '1.2' ---
int(0)
--- testing: '123abc' % '-7.7' ---
int(4)
--- testing: '123abc' % '123abc' ---
int(0)
--- testing: '123abc' % '123e5' ---
int(0)
--- testing: '123abc' % '123e5xyz' ---
int(0)
--- testing: '123abc' % ' 123abc' ---
int(0)
--- testing: '123abc' % '123 abc' ---
int(0)
--- testing: '123abc' % '123abc ' ---
int(0)
--- testing: '123abc' % '3.4a' ---
int(0)
--- testing: '123e5' % '65' ---
int(58)
--- testing: '123e5' % '-44' ---
int(35)
--- testing: '123e5' % '1.2' ---
int(0)
--- testing: '123e5' % '-7.7' ---
int(4)
--- testing: '123e5' % '123abc' ---
int(0)
--- testing: '123e5' % '123e5' ---
int(0)
--- testing: '123e5' % '123e5xyz' ---
int(0)
--- testing: '123e5' % ' 123abc' ---
int(0)
--- testing: '123e5' % '123 abc' ---
int(0)
--- testing: '123e5' % '123abc ' ---
int(0)
--- testing: '123e5' % '3.4a' ---
int(0)
--- testing: '123e5xyz' % '65' ---
int(58)
--- testing: '123e5xyz' % '-44' ---
int(35)
--- testing: '123e5xyz' % '1.2' ---
int(0)
--- testing: '123e5xyz' % '-7.7' ---
int(4)
--- testing: '123e5xyz' % '123abc' ---
int(0)
--- testing: '123e5xyz' % '123e5' ---
int(0)
--- testing: '123e5xyz' % '123e5xyz' ---
int(0)
--- testing: '123e5xyz' % ' 123abc' ---
int(0)
--- testing: '123e5xyz' % '123 abc' ---
int(0)
--- testing: '123e5xyz' % '123abc ' ---
int(0)
--- testing: '123e5xyz' % '3.4a' ---
int(0)
--- testing: ' 123abc' % '65' ---
int(58)
--- testing: ' 123abc' % '-44' ---
int(35)
--- testing: ' 123abc' % '1.2' ---
int(0)
--- testing: ' 123abc' % '-7.7' ---
int(4)
--- testing: ' 123abc' % '123abc' ---
int(0)
--- testing: ' 123abc' % '123e5' ---
int(0)
--- testing: ' 123abc' % '123e5xyz' ---
int(0)
--- testing: ' 123abc' % ' 123abc' ---
int(0)
--- testing: ' 123abc' % '123 abc' ---
int(0)
--- testing: ' 123abc' % '123abc ' ---
int(0)
--- testing: ' 123abc' % '3.4a' ---
int(0)
--- testing: '123 abc' % '65' ---
int(58)
--- testing: '123 abc' % '-44' ---
int(35)
--- testing: '123 abc' % '1.2' ---
int(0)
--- testing: '123 abc' % '-7.7' ---
int(4)
--- testing: '123 abc' % '123abc' ---
int(0)
--- testing: '123 abc' % '123e5' ---
int(0)
--- testing: '123 abc' % '123e5xyz' ---
int(0)
--- testing: '123 abc' % ' 123abc' ---
int(0)
--- testing: '123 abc' % '123 abc' ---
int(0)
--- testing: '123 abc' % '123abc ' ---
int(0)
--- testing: '123 abc' % '3.4a' ---
int(0)
--- testing: '123abc ' % '65' ---
int(58)
--- testing: '123abc ' % '-44' ---
int(35)
--- testing: '123abc ' % '1.2' ---
int(0)
--- testing: '123abc ' % '-7.7' ---
int(4)
--- testing: '123abc ' % '123abc' ---
int(0)
--- testing: '123abc ' % '123e5' ---
int(0)
--- testing: '123abc ' % '123e5xyz' ---
int(0)
--- testing: '123abc ' % ' 123abc' ---
int(0)
--- testing: '123abc ' % '123 abc' ---
int(0)
--- testing: '123abc ' % '123abc ' ---
int(0)
--- testing: '123abc ' % '3.4a' ---
int(0)
--- testing: '3.4a' % '65' ---
int(3)
--- testing: '3.4a' % '-44' ---
int(3)
--- testing: '3.4a' % '1.2' ---
int(0)
--- testing: '3.4a' % '-7.7' ---
int(3)
--- testing: '3.4a' % '123abc' ---
int(3)
--- testing: '3.4a' % '123e5' ---
int(3)
--- testing: '3.4a' % '123e5xyz' ---
int(3)
--- testing: '3.4a' % ' 123abc' ---
int(3)
--- testing: '3.4a' % '123 abc' ---
int(3)
--- testing: '3.4a' % '123abc ' ---
int(3)
--- testing: '3.4a' % '3.4a' ---
int(0)
--- testing: '0' % '0' ---
Exception: Division by zero
--- testing: '0' % '65' ---
int(0)
--- testing: '0' % '-44' ---
int(0)
--- testing: '0' % '1.2' ---
int(0)
--- testing: '0' % '-7.7' ---
int(0)
--- testing: '0' % 'abc' ---
Exception: Division by zero
--- testing: '0' % '123abc' ---
int(0)
--- testing: '0' % '123e5' ---
int(0)
--- testing: '0' % '123e5xyz' ---
int(0)
--- testing: '0' % ' 123abc' ---
int(0)
--- testing: '0' % '123 abc' ---
int(0)
--- testing: '0' % '123abc ' ---
int(0)
--- testing: '0' % '3.4a' ---
int(0)
--- testing: '0' % 'a5.9' ---
Exception: Division by zero
--- testing: '65' % '0' ---
Exception: Division by zero
--- testing: '65' % '65' ---
int(0)
--- testing: '65' % '-44' ---
int(21)
--- testing: '65' % '1.2' ---
int(0)
--- testing: '65' % '-7.7' ---
int(2)
--- testing: '65' % 'abc' ---
Exception: Division by zero
--- testing: '65' % '123abc' ---
int(65)
--- testing: '65' % '123e5' ---
int(65)
--- testing: '65' % '123e5xyz' ---
int(65)
--- testing: '65' % ' 123abc' ---
int(65)
--- testing: '65' % '123 abc' ---
int(65)
--- testing: '65' % '123abc ' ---
int(65)
--- testing: '65' % '3.4a' ---
int(2)
--- testing: '65' % 'a5.9' ---
Exception: Division by zero
--- testing: '-44' % '0' ---
Exception: Division by zero
--- testing: '-44' % '65' ---
int(-44)
--- testing: '-44' % '-44' ---
int(0)
--- testing: '-44' % '1.2' ---
int(0)
--- testing: '-44' % '-7.7' ---
int(-2)
--- testing: '-44' % 'abc' ---
Exception: Division by zero
--- testing: '-44' % '123abc' ---
int(-44)
--- testing: '-44' % '123e5' ---
int(-44)
--- testing: '-44' % '123e5xyz' ---
int(-44)
--- testing: '-44' % ' 123abc' ---
int(-44)
--- testing: '-44' % '123 abc' ---
int(-44)
--- testing: '-44' % '123abc ' ---
int(-44)
--- testing: '-44' % '3.4a' ---
int(-2)
--- testing: '-44' % 'a5.9' ---
Exception: Division by zero
--- testing: '1.2' % '0' ---
Exception: Division by zero
--- testing: '1.2' % '65' ---
int(1)
--- testing: '1.2' % '-44' ---
int(1)
--- testing: '1.2' % '1.2' ---
int(0)
--- testing: '1.2' % '-7.7' ---
int(1)
--- testing: '1.2' % 'abc' ---
Exception: Division by zero
--- testing: '1.2' % '123abc' ---
int(1)
--- testing: '1.2' % '123e5' ---
int(1)
--- testing: '1.2' % '123e5xyz' ---
int(1)
--- testing: '1.2' % ' 123abc' ---
int(1)
--- testing: '1.2' % '123 abc' ---
int(1)
--- testing: '1.2' % '123abc ' ---
int(1)
--- testing: '1.2' % '3.4a' ---
int(1)
--- testing: '1.2' % 'a5.9' ---
Exception: Division by zero
--- testing: '-7.7' % '0' ---
Exception: Division by zero
--- testing: '-7.7' % '65' ---
int(-7)
--- testing: '-7.7' % '-44' ---
int(-7)
--- testing: '-7.7' % '1.2' ---
int(0)
--- testing: '-7.7' % '-7.7' ---
int(0)
--- testing: '-7.7' % 'abc' ---
Exception: Division by zero
--- testing: '-7.7' % '123abc' ---
int(-7)
--- testing: '-7.7' % '123e5' ---
int(-7)
--- testing: '-7.7' % '123e5xyz' ---
int(-7)
--- testing: '-7.7' % ' 123abc' ---
int(-7)
--- testing: '-7.7' % '123 abc' ---
int(-7)
--- testing: '-7.7' % '123abc ' ---
int(-7)
--- testing: '-7.7' % '3.4a' ---
int(-1)
--- testing: '-7.7' % 'a5.9' ---
Exception: Division by zero
--- testing: 'abc' % '0' ---
Exception: Division by zero
--- testing: 'abc' % '65' ---
int(0)
--- testing: 'abc' % '-44' ---
int(0)
--- testing: 'abc' % '1.2' ---
int(0)
--- testing: 'abc' % '-7.7' ---
int(0)
--- testing: 'abc' % 'abc' ---
Exception: Division by zero
--- testing: 'abc' % '123abc' ---
int(0)
--- testing: 'abc' % '123e5' ---
int(0)
--- testing: 'abc' % '123e5xyz' ---
int(0)
--- testing: 'abc' % ' 123abc' ---
int(0)
--- testing: 'abc' % '123 abc' ---
int(0)
--- testing: 'abc' % '123abc ' ---
int(0)
--- testing: 'abc' % '3.4a' ---
int(0)
--- testing: 'abc' % 'a5.9' ---
Exception: Division by zero
--- testing: '123abc' % '0' ---
Exception: Division by zero
--- testing: '123abc' % '65' ---
int(58)
--- testing: '123abc' % '-44' ---
int(35)
--- testing: '123abc' % '1.2' ---
int(0)
--- testing: '123abc' % '-7.7' ---
int(4)
--- testing: '123abc' % 'abc' ---
Exception: Division by zero
--- testing: '123abc' % '123abc' ---
int(0)
--- testing: '123abc' % '123e5' ---
int(0)
--- testing: '123abc' % '123e5xyz' ---
int(0)
--- testing: '123abc' % ' 123abc' ---
int(0)
--- testing: '123abc' % '123 abc' ---
int(0)
--- testing: '123abc' % '123abc ' ---
int(0)
--- testing: '123abc' % '3.4a' ---
int(0)
--- testing: '123abc' % 'a5.9' ---
Exception: Division by zero
--- testing: '123e5' % '0' ---
Exception: Division by zero
--- testing: '123e5' % '65' ---
int(58)
--- testing: '123e5' % '-44' ---
int(35)
--- testing: '123e5' % '1.2' ---
int(0)
--- testing: '123e5' % '-7.7' ---
int(4)
--- testing: '123e5' % 'abc' ---
Exception: Division by zero
--- testing: '123e5' % '123abc' ---
int(0)
--- testing: '123e5' % '123e5' ---
int(0)
--- testing: '123e5' % '123e5xyz' ---
int(0)
--- testing: '123e5' % ' 123abc' ---
int(0)
--- testing: '123e5' % '123 abc' ---
int(0)
--- testing: '123e5' % '123abc ' ---
int(0)
--- testing: '123e5' % '3.4a' ---
int(0)
--- testing: '123e5' % 'a5.9' ---
Exception: Division by zero
--- testing: '123e5xyz' % '0' ---
Exception: Division by zero
--- testing: '123e5xyz' % '65' ---
int(58)
--- testing: '123e5xyz' % '-44' ---
int(35)
--- testing: '123e5xyz' % '1.2' ---
int(0)
--- testing: '123e5xyz' % '-7.7' ---
int(4)
--- testing: '123e5xyz' % 'abc' ---
Exception: Division by zero
--- testing: '123e5xyz' % '123abc' ---
int(0)
--- testing: '123e5xyz' % '123e5' ---
int(0)
--- testing: '123e5xyz' % '123e5xyz' ---
int(0)
--- testing: '123e5xyz' % ' 123abc' ---
int(0)
--- testing: '123e5xyz' % '123 abc' ---
int(0)
--- testing: '123e5xyz' % '123abc ' ---
int(0)
--- testing: '123e5xyz' % '3.4a' ---
int(0)
--- testing: '123e5xyz' % 'a5.9' ---
Exception: Division by zero
--- testing: ' 123abc' % '0' ---
Exception: Division by zero
--- testing: ' 123abc' % '65' ---
int(58)
--- testing: ' 123abc' % '-44' ---
int(35)
--- testing: ' 123abc' % '1.2' ---
int(0)
--- testing: ' 123abc' % '-7.7' ---
int(4)
--- testing: ' 123abc' % 'abc' ---
Exception: Division by zero
--- testing: ' 123abc' % '123abc' ---
int(0)
--- testing: ' 123abc' % '123e5' ---
int(0)
--- testing: ' 123abc' % '123e5xyz' ---
int(0)
--- testing: ' 123abc' % ' 123abc' ---
int(0)
--- testing: ' 123abc' % '123 abc' ---
int(0)
--- testing: ' 123abc' % '123abc ' ---
int(0)
--- testing: ' 123abc' % '3.4a' ---
int(0)
--- testing: ' 123abc' % 'a5.9' ---
Exception: Division by zero
--- testing: '123 abc' % '0' ---
Exception: Division by zero
--- testing: '123 abc' % '65' ---
int(58)
--- testing: '123 abc' % '-44' ---
int(35)
--- testing: '123 abc' % '1.2' ---
int(0)
--- testing: '123 abc' % '-7.7' ---
int(4)
--- testing: '123 abc' % 'abc' ---
Exception: Division by zero
--- testing: '123 abc' % '123abc' ---
int(0)
--- testing: '123 abc' % '123e5' ---
int(0)
--- testing: '123 abc' % '123e5xyz' ---
int(0)
--- testing: '123 abc' % ' 123abc' ---
int(0)
--- testing: '123 abc' % '123 abc' ---
int(0)
--- testing: '123 abc' % '123abc ' ---
int(0)
--- testing: '123 abc' % '3.4a' ---
int(0)
--- testing: '123 abc' % 'a5.9' ---
Exception: Division by zero
--- testing: '123abc ' % '0' ---
Exception: Division by zero
--- testing: '123abc ' % '65' ---
int(58)
--- testing: '123abc ' % '-44' ---
int(35)
--- testing: '123abc ' % '1.2' ---
int(0)
--- testing: '123abc ' % '-7.7' ---
int(4)
--- testing: '123abc ' % 'abc' ---
Exception: Division by zero
--- testing: '123abc ' % '123abc' ---
int(0)
--- testing: '123abc ' % '123e5' ---
int(0)
--- testing: '123abc ' % '123e5xyz' ---
int(0)
--- testing: '123abc ' % ' 123abc' ---
int(0)
--- testing: '123abc ' % '123 abc' ---
int(0)
--- testing: '123abc ' % '123abc ' ---
int(0)
--- testing: '123abc ' % '3.4a' ---
int(0)
--- testing: '123abc ' % 'a5.9' ---
Exception: Division by zero
--- testing: '3.4a' % '0' ---
Exception: Division by zero
--- testing: '3.4a' % '65' ---
int(3)
--- testing: '3.4a' % '-44' ---
int(3)
--- testing: '3.4a' % '1.2' ---
int(0)
--- testing: '3.4a' % '-7.7' ---
int(3)
--- testing: '3.4a' % 'abc' ---
Exception: Division by zero
--- testing: '3.4a' % '123abc' ---
int(3)
--- testing: '3.4a' % '123e5' ---
int(3)
--- testing: '3.4a' % '123e5xyz' ---
int(3)
--- testing: '3.4a' % ' 123abc' ---
int(3)
--- testing: '3.4a' % '123 abc' ---
int(3)
--- testing: '3.4a' % '123abc ' ---
int(3)
--- testing: '3.4a' % '3.4a' ---
int(0)
--- testing: '3.4a' % 'a5.9' ---
Exception: Division by zero
--- testing: 'a5.9' % '0' ---
Exception: Division by zero
--- testing: 'a5.9' % '65' ---
int(0)
--- testing: 'a5.9' % '-44' ---
int(0)
--- testing: 'a5.9' % '1.2' ---
int(0)
--- testing: 'a5.9' % '-7.7' ---
int(0)
--- testing: 'a5.9' % 'abc' ---
Exception: Division by zero
--- testing: 'a5.9' % '123abc' ---
int(0)
--- testing: 'a5.9' % '123e5' ---
int(0)
--- testing: 'a5.9' % '123e5xyz' ---
int(0)
--- testing: 'a5.9' % ' 123abc' ---
int(0)
--- testing: 'a5.9' % '123 abc' ---
int(0)
--- testing: 'a5.9' % '123abc ' ---
int(0)
--- testing: 'a5.9' % '3.4a' ---
int(0)
--- testing: 'a5.9' % 'a5.9' ---
Exception: Division by zero
===DONE===

View File

@ -19,7 +19,8 @@ var_dump(ini_get('track_errors'));
ini_set('display_errors', 0);
var_dump(ini_get('display_errors'));
var_dump($php_errormsg);
ini_set("zend.assertions", -1);
$zero = 0;
$error = 1 / $zero;
var_dump($php_errormsg);
?>
--EXPECTF--
@ -29,4 +30,4 @@ string(1) "0"
string(1) "1"
string(1) "0"
NULL
string(%d) "%senabled or disabled%s"
string(%d) "%sivision by zer%s"

View File

@ -19,7 +19,8 @@ var_dump(ini_get('track_errors'));
ini_set('display_errors', 0);
var_dump(ini_get('display_errors'));
var_dump($php_errormsg);
ini_set("zend.assertions", -1);
$zero = 0;
$error = 1 / $zero;
var_dump($php_errormsg);
?>
--EXPECTF--
@ -29,4 +30,4 @@ string(1) "0"
string(1) "1"
string(1) "0"
NULL
string(%d) "%senabled or disabled%s"
string(%d) "%sivision by zer%s"