diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-03-05 16:56:42 +0100 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-03-09 11:29:40 +0100 |
commit | f44dd16b7a2b79285163d5a4c10db60fd5c6648d (patch) | |
tree | 152c8f60bfdcb30074c2e0f2fe7e72c2a965ece1 /tests | |
parent | c5f091e47f8e958715adc9fcb791f3a15e3932c6 (diff) | |
download | php-git-f44dd16b7a2b79285163d5a4c10db60fd5c6648d.tar.gz |
Improve error message of foreach
Closes GH-5240
Diffstat (limited to 'tests')
-rw-r--r-- | tests/classes/bug27468.phpt | 2 | ||||
-rw-r--r-- | tests/lang/bug27439.phpt | 6 | ||||
-rw-r--r-- | tests/lang/bug29566.phpt | 2 | ||||
-rw-r--r-- | tests/lang/foreachLoop.003.phpt | 10 |
4 files changed, 10 insertions, 10 deletions
diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt index 4ef8d44a61..d590683c82 100644 --- a/tests/classes/bug27468.phpt +++ b/tests/classes/bug27468.phpt @@ -13,5 +13,5 @@ echo 'OK'; --EXPECTF-- Warning: Undefined property: foo::$x in %s on line %d -Warning: Invalid argument supplied for foreach() in %sbug27468.php on line 4 +Warning: foreach() argument must be of type array|object, null given in %sbug27468.php on line 4 OK diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt index ceb714d81b..c9f08a0403 100644 --- a/tests/lang/bug27439.phpt +++ b/tests/lang/bug27439.phpt @@ -67,10 +67,10 @@ echo "===DONE==="; 123 Warning: Undefined property: test::$foobar in %s on line %d -Warning: Invalid argument supplied for foreach() in %s on line %d +Warning: foreach() argument must be of type array|object, null given in %s on line %d -Warning: Invalid argument supplied for foreach() in %s on line %d +Warning: foreach() argument must be of type array|object, string given in %s on line %d -Warning: Invalid argument supplied for foreach() in %s on line %d +Warning: foreach() argument must be of type array|object, string given in %s on line %d 123 ===DONE=== diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt index 9c9a466388..0e6d45158b 100644 --- a/tests/lang/bug29566.phpt +++ b/tests/lang/bug29566.phpt @@ -13,4 +13,4 @@ foreach($var['nosuchkey'] as $v) { --EXPECTF-- Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d -Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d +Warning: foreach() argument must be of type array|object, string given in %sbug29566.php on line %d diff --git a/tests/lang/foreachLoop.003.phpt b/tests/lang/foreachLoop.003.phpt index 352ac335b7..c4ca3019f3 100644 --- a/tests/lang/foreachLoop.003.phpt +++ b/tests/lang/foreachLoop.003.phpt @@ -33,13 +33,13 @@ echo "done.\n"; --EXPECTF-- Not an array. -Warning: Invalid argument supplied for foreach() in %s on line 4 +Warning: foreach() argument must be of type array|object, bool given in %s on line 4 -Warning: Invalid argument supplied for foreach() in %s on line 9 +Warning: foreach() argument must be of type array|object, null given in %s on line 9 -Warning: Invalid argument supplied for foreach() in %s on line 14 +Warning: foreach() argument must be of type array|object, int given in %s on line 14 -Warning: Invalid argument supplied for foreach() in %s on line 19 +Warning: foreach() argument must be of type array|object, float given in %s on line 19 -Warning: Invalid argument supplied for foreach() in %s on line 24 +Warning: foreach() argument must be of type array|object, string given in %s on line 24 done. |