diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt index f89c49e61380a..a6aef5ffb9dc2 100644 --- a/Zend/tests/024.phpt +++ b/Zend/tests/024.phpt @@ -16,19 +16,23 @@ var_dump($a->$b->{$c[1]}); ?> --EXPECTF-- Notice: Undefined variable: a in %s on line %d + +Notice: Trying to get index of a non-array in %s on line 3 NULL -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: a in %s on line %d + +Notice: Undefined variable: c in %s on line %d -Notice: Undefined variable: %s in %s on line %d +Notice: Trying to get index of a non-array in %s on line %d NULL Notice: Undefined variable: a in %s on line %d int(1) -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: a in %s on line %d -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: b in %s on line %d int(0) Notice: Undefined variable: a in %s on line %d @@ -45,6 +49,8 @@ NULL Notice: Undefined variable: c in %s on line %d +Notice: Trying to get index of a non-array in %s on line 11 + Notice: Trying to get property of non-object in %s on line %d Notice: Trying to get property of non-object in %s on line %d diff --git a/Zend/tests/033.phpt b/Zend/tests/033.phpt index 17319e0d6105c..60792b9aff59d 100644 --- a/Zend/tests/033.phpt +++ b/Zend/tests/033.phpt @@ -20,10 +20,40 @@ $arr[][]->bar = 2; Notice: Undefined variable: arr in %s on line %d +Notice: Trying to get index of a non-array in %s on line 3 + +Notice: Trying to get index of a non-array in %s on line 3 + +Notice: Trying to get index of a non-array in %s on line 3 + +Notice: Trying to get index of a non-array in %s on line 3 + +Notice: Trying to get index of a non-array in %s on line 3 + Notice: Undefined variable: arr in %s on line %d +Notice: Trying to get index of a non-array in %s on line 5 + +Notice: Trying to get index of a non-array in %s on line 5 + +Notice: Trying to get index of a non-array in %s on line 5 + +Notice: Trying to get index of a non-array in %s on line 5 + +Notice: Trying to get index of a non-array in %s on line 5 + Notice: Undefined variable: arr in %s on line %d +Notice: Trying to get index of a non-array in %s on line 7 + +Notice: Trying to get index of a non-array in %s on line 7 + +Notice: Trying to get index of a non-array in %s on line 7 + +Notice: Trying to get index of a non-array in %s on line 7 + +Notice: Trying to get index of a non-array in %s on line 7 + Notice: Trying to get property of non-object in %s on line %d Warning: Creating default object from empty value in %s on line %d diff --git a/Zend/tests/array_access_nonarray.phpt b/Zend/tests/array_access_nonarray.phpt new file mode 100644 index 0000000000000..29ad5a8e35fc3 --- /dev/null +++ b/Zend/tests/array_access_nonarray.phpt @@ -0,0 +1,477 @@ +--TEST-- +Array access on non-array +--FILE-- + null, + 'int' => 42, + 'float' => 3.14159, + 'bool' => true, + 'string' => 'hello world', + 'object' => new StdClass(), +); + +foreach ($values as $type => $a) { + print "\n\n--- {$type} ---\n"; + try { + var_dump($a[0]); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump($a[0][1]); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump($a['foo']); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump($a['foo']['bar']); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + $b = isset($a[0]); + var_dump($b); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + $b = isset($a[0][0]); + var_dump($b); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + unset($a, $b); +} + +foreach ($values as $type => $a) { + print "\n\n--- obj->{$type} ---\n"; + $obj = new StdClass(); + $obj->test = $a; + + try { + var_dump($obj->test[0]); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump($obj->test[0][1]); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump($obj->test['foo']); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump($obj->test['foo']['bar']); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + $b = isset($obj->test[0]); + var_dump($b); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + $b = isset($obj->test[0][0]); + var_dump($b); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + unset($a, $b); +} + +function returnInput($input) { + return $input; +} + +foreach ($values as $type => $a) { + print "\n\n--- func() {$type} ---\n"; + try { + var_dump(returnInput($a)[0]); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump(returnInput($a)[0][1]); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump(returnInput($a)['foo']); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + var_dump(returnInput($a)['foo']['bar']); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + $b = isset(returnInput($a)[0]); + var_dump($b); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + + try { + $b = isset(returnInput($a)[0][0]); + var_dump($b); + } catch (Error $e) { + print "Error: ". $e->getMessage() ." on line ". $e->getLine() ."\n"; + } + unset($a, $b); +} + + + +--EXPECTF-- +--- null --- + +Notice: Trying to get index of a non-array in %s on line 14 +NULL + +Notice: Trying to get index of a non-array in %s on line 20 + +Notice: Trying to get index of a non-array in %s on line 20 +NULL + +Notice: Trying to get index of a non-array in %s on line 26 +NULL + +Notice: Trying to get index of a non-array in %s on line 32 + +Notice: Trying to get index of a non-array in %s on line 32 +NULL +bool(false) +bool(false) + + +--- int --- + +Notice: Trying to get index of a non-array in %s on line 14 +NULL + +Notice: Trying to get index of a non-array in %s on line 20 + +Notice: Trying to get index of a non-array in %s on line 20 +NULL + +Notice: Trying to get index of a non-array in %s on line 26 +NULL + +Notice: Trying to get index of a non-array in %s on line 32 + +Notice: Trying to get index of a non-array in %s on line 32 +NULL +bool(false) +bool(false) + + +--- float --- + +Notice: Trying to get index of a non-array in %s on line 14 +NULL + +Notice: Trying to get index of a non-array in %s on line 20 + +Notice: Trying to get index of a non-array in %s on line 20 +NULL + +Notice: Trying to get index of a non-array in %s on line 26 +NULL + +Notice: Trying to get index of a non-array in %s on line 32 + +Notice: Trying to get index of a non-array in %s on line 32 +NULL +bool(false) +bool(false) + + +--- bool --- + +Notice: Trying to get index of a non-array in %s on line 14 +NULL + +Notice: Trying to get index of a non-array in %s on line 20 + +Notice: Trying to get index of a non-array in %s on line 20 +NULL + +Notice: Trying to get index of a non-array in %s on line 26 +NULL + +Notice: Trying to get index of a non-array in %s on line 32 + +Notice: Trying to get index of a non-array in %s on line 32 +NULL +bool(false) +bool(false) + + +--- string --- +string(1) "h" + +Notice: Uninitialized string offset: 1 in %s on line 20 +string(0) "" + +Warning: Illegal string offset 'foo' in %s on line 26 +string(1) "h" + +Warning: Illegal string offset 'foo' in %s on line 32 + +Warning: Illegal string offset 'bar' in %s on line 32 +string(1) "h" +bool(true) +bool(true) + + +--- object --- +Error: Cannot use object of type stdClass as array on line 14 +Error: Cannot use object of type stdClass as array on line 20 +Error: Cannot use object of type stdClass as array on line 26 +Error: Cannot use object of type stdClass as array on line 32 +Error: Cannot use object of type stdClass as array on line 38 +Error: Cannot use object of type stdClass as array on line 45 + + +--- obj->null --- + +Notice: Trying to get index of a non-array in %s on line 59 +NULL + +Notice: Trying to get index of a non-array in %s on line 65 + +Notice: Trying to get index of a non-array in %s on line 65 +NULL + +Notice: Trying to get index of a non-array in %s on line 71 +NULL + +Notice: Trying to get index of a non-array in %s on line 77 + +Notice: Trying to get index of a non-array in %s on line 77 +NULL +bool(false) +bool(false) + + +--- obj->int --- + +Notice: Trying to get index of a non-array in %s on line 59 +NULL + +Notice: Trying to get index of a non-array in %s on line 65 + +Notice: Trying to get index of a non-array in %s on line 65 +NULL + +Notice: Trying to get index of a non-array in %s on line 71 +NULL + +Notice: Trying to get index of a non-array in %s on line 77 + +Notice: Trying to get index of a non-array in %s on line 77 +NULL +bool(false) +bool(false) + + +--- obj->float --- + +Notice: Trying to get index of a non-array in %s on line 59 +NULL + +Notice: Trying to get index of a non-array in %s on line 65 + +Notice: Trying to get index of a non-array in %s on line 65 +NULL + +Notice: Trying to get index of a non-array in %s on line 71 +NULL + +Notice: Trying to get index of a non-array in %s on line 77 + +Notice: Trying to get index of a non-array in %s on line 77 +NULL +bool(false) +bool(false) + + +--- obj->bool --- + +Notice: Trying to get index of a non-array in %s on line 59 +NULL + +Notice: Trying to get index of a non-array in %s on line 65 + +Notice: Trying to get index of a non-array in %s on line 65 +NULL + +Notice: Trying to get index of a non-array in %s on line 71 +NULL + +Notice: Trying to get index of a non-array in %s on line 77 + +Notice: Trying to get index of a non-array in %s on line 77 +NULL +bool(false) +bool(false) + + +--- obj->string --- +string(1) "h" + +Notice: Uninitialized string offset: 1 in %s on line 65 +string(0) "" + +Warning: Illegal string offset 'foo' in %s on line 71 +string(1) "h" + +Warning: Illegal string offset 'foo' in %s on line 77 + +Warning: Illegal string offset 'bar' in %s on line 77 +string(1) "h" +bool(true) +bool(true) + + +--- obj->object --- +Error: Cannot use object of type stdClass as array on line 59 +Error: Cannot use object of type stdClass as array on line 65 +Error: Cannot use object of type stdClass as array on line 71 +Error: Cannot use object of type stdClass as array on line 77 +Error: Cannot use object of type stdClass as array on line 83 +Error: Cannot use object of type stdClass as array on line 90 + + +--- func() null --- + +Notice: Trying to get index of a non-array in %s on line 105 +NULL + +Notice: Trying to get index of a non-array in %s on line 111 + +Notice: Trying to get index of a non-array in %s on line 111 +NULL + +Notice: Trying to get index of a non-array in %s on line 117 +NULL + +Notice: Trying to get index of a non-array in %s on line 123 + +Notice: Trying to get index of a non-array in %s on line 123 +NULL +bool(false) +bool(false) + + +--- func() int --- + +Notice: Trying to get index of a non-array in %s on line 105 +NULL + +Notice: Trying to get index of a non-array in %s on line 111 + +Notice: Trying to get index of a non-array in %s on line 111 +NULL + +Notice: Trying to get index of a non-array in %s on line 117 +NULL + +Notice: Trying to get index of a non-array in %s on line 123 + +Notice: Trying to get index of a non-array in %s on line 123 +NULL +bool(false) +bool(false) + + +--- func() float --- + +Notice: Trying to get index of a non-array in %s on line 105 +NULL + +Notice: Trying to get index of a non-array in %s on line 111 + +Notice: Trying to get index of a non-array in %s on line 111 +NULL + +Notice: Trying to get index of a non-array in %s on line 117 +NULL + +Notice: Trying to get index of a non-array in %s on line 123 + +Notice: Trying to get index of a non-array in %s on line 123 +NULL +bool(false) +bool(false) + + +--- func() bool --- + +Notice: Trying to get index of a non-array in %s on line 105 +NULL + +Notice: Trying to get index of a non-array in %s on line 111 + +Notice: Trying to get index of a non-array in %s on line 111 +NULL + +Notice: Trying to get index of a non-array in %s on line 117 +NULL + +Notice: Trying to get index of a non-array in %s on line 123 + +Notice: Trying to get index of a non-array in %s on line 123 +NULL +bool(false) +bool(false) + + +--- func() string --- +string(1) "h" + +Notice: Uninitialized string offset: 1 in %s on line 111 +string(0) "" + +Warning: Illegal string offset 'foo' in %s on line 117 +string(1) "h" + +Warning: Illegal string offset 'foo' in %s on line 123 + +Warning: Illegal string offset 'bar' in %s on line 123 +string(1) "h" +bool(true) +bool(true) + + +--- func() object --- +Error: Cannot use object of type stdClass as array on line 105 +Error: Cannot use object of type stdClass as array on line 111 +Error: Cannot use object of type stdClass as array on line 117 +Error: Cannot use object of type stdClass as array on line 123 +Error: Cannot use object of type stdClass as array on line 129 +Error: Cannot use object of type stdClass as array on line 136 diff --git a/Zend/tests/assign_to_var_003.phpt b/Zend/tests/assign_to_var_003.phpt index 911ee0bb8e626..aa67015b3c843 100644 --- a/Zend/tests/assign_to_var_003.phpt +++ b/Zend/tests/assign_to_var_003.phpt @@ -13,6 +13,7 @@ var_dump($var1); echo "Done\n"; ?> --EXPECTF-- +Notice: Trying to get index of a non-array in %s on line 5 NULL NULL Done diff --git a/Zend/tests/bug24436.phpt b/Zend/tests/bug24436.phpt index 0c261b668e30d..1ab97adf4e34b 100644 --- a/Zend/tests/bug24436.phpt +++ b/Zend/tests/bug24436.phpt @@ -17,7 +17,7 @@ class test { $test1 = new test(); ?> ---EXPECT-- +--EXPECTF-- test1 test2 test1 diff --git a/Zend/tests/dereference_002.phpt b/Zend/tests/dereference_002.phpt index d16e1bb483037..faa304519d545 100644 --- a/Zend/tests/dereference_002.phpt +++ b/Zend/tests/dereference_002.phpt @@ -69,6 +69,8 @@ array(2) { int(5) } int(1) + +Notice: Trying to get index of a non-array in %s on line 29 NULL Notice: Undefined offset: 4 in %s on line %d diff --git a/Zend/tests/dereference_010.phpt b/Zend/tests/dereference_010.phpt index 981fe3116082e..1e906053c0e9c 100644 --- a/Zend/tests/dereference_010.phpt +++ b/Zend/tests/dereference_010.phpt @@ -21,7 +21,10 @@ var_dump(b()[1]); ?> --EXPECTF-- +Notice: Trying to get index of a non-array in %s on line 10 NULL + +Notice: Trying to get index of a non-array in %s on line 11 NULL Fatal error: Uncaught Error: Cannot use object of type stdClass as array in %s:%d diff --git a/Zend/tests/dereference_014.phpt b/Zend/tests/dereference_014.phpt index 62dffd36980da..9a63a65796d79 100644 --- a/Zend/tests/dereference_014.phpt +++ b/Zend/tests/dereference_014.phpt @@ -27,8 +27,12 @@ var_dump($h); ?> --EXPECTF-- +Notice: Trying to get index of a non-array in %s on line 19 + Notice: Trying to get property of non-object in %s on line %d NULL +Notice: Trying to get index of a non-array in %s on line 22 + Notice: Trying to get property of non-object in %s on line %d NULL diff --git a/Zend/tests/isset_003.phpt b/Zend/tests/isset_003.phpt index 92225b59066bb..7d8e9ad58d11f 100644 --- a/Zend/tests/isset_003.phpt +++ b/Zend/tests/isset_003.phpt @@ -33,6 +33,8 @@ Notice: Undefined variable: c in %s on line %d Notice: Undefined variable: d in %s on line %d +Notice: Trying to get index of a non-array in %s on line %d + Notice: Trying to get property of non-object in %s on line %d bool(false) bool(true) diff --git a/Zend/tests/isset_003_2_4.phpt b/Zend/tests/isset_003_2_4.phpt index 42d8cc6a089de..939c1ad443c10 100644 --- a/Zend/tests/isset_003_2_4.phpt +++ b/Zend/tests/isset_003_2_4.phpt @@ -35,6 +35,8 @@ Notice: Undefined variable: c in %s on line %d Notice: Undefined variable: d in %s on line %d +Notice: Trying to get index of a non-array in %s on line %d + Notice: Trying to get property of non-object in %s on line %d bool(false) bool(true) diff --git a/Zend/tests/offset_bool.phpt b/Zend/tests/offset_bool.phpt index 9bf8a89da7683..6719d11e7c25d 100644 --- a/Zend/tests/offset_bool.phpt +++ b/Zend/tests/offset_bool.phpt @@ -25,13 +25,31 @@ var_dump($bool[$arr]); echo "Done\n"; ?> --EXPECTF-- + +Notice: Trying to get index of a non-array in %s on line 5 NULL + +Notice: Trying to get index of a non-array in %s on line 6 NULL + +Notice: Trying to get index of a non-array in %s on line 7 NULL + +Notice: Trying to get index of a non-array in %s on line 8 NULL + +Notice: Trying to get index of a non-array in %s on line 10 NULL + +Notice: Trying to get index of a non-array in %s on line 11 NULL + +Notice: Trying to get index of a non-array in %s on line 14 NULL + +Notice: Trying to get index of a non-array in %s on line 17 NULL + +Notice: Trying to get index of a non-array in %s on line 20 NULL Done diff --git a/Zend/tests/offset_long.phpt b/Zend/tests/offset_long.phpt index c65a5ba3f8d4d..21f4a6641d0f1 100644 --- a/Zend/tests/offset_long.phpt +++ b/Zend/tests/offset_long.phpt @@ -25,13 +25,31 @@ var_dump($long[$arr]); echo "Done\n"; ?> --EXPECTF-- + +Notice: Trying to get index of a non-array in %s on line 5 NULL + +Notice: Trying to get index of a non-array in %s on line 6 NULL + +Notice: Trying to get index of a non-array in %s on line 7 NULL + +Notice: Trying to get index of a non-array in %s on line 8 NULL + +Notice: Trying to get index of a non-array in %s on line 10 NULL + +Notice: Trying to get index of a non-array in %s on line 11 NULL + +Notice: Trying to get index of a non-array in %s on line 14 NULL + +Notice: Trying to get index of a non-array in %s on line 17 NULL + +Notice: Trying to get index of a non-array in %s on line 20 NULL Done diff --git a/Zend/tests/offset_null.phpt b/Zend/tests/offset_null.phpt index 9364f0a2e522d..eade8ba02bc5c 100644 --- a/Zend/tests/offset_null.phpt +++ b/Zend/tests/offset_null.phpt @@ -25,13 +25,31 @@ var_dump($null[$arr]); echo "Done\n"; ?> --EXPECTF-- + +Notice: Trying to get index of a non-array in %s on line 5 NULL + +Notice: Trying to get index of a non-array in %s on line 6 NULL + +Notice: Trying to get index of a non-array in %s on line 7 NULL + +Notice: Trying to get index of a non-array in %s on line 8 NULL + +Notice: Trying to get index of a non-array in %s on line 10 NULL + +Notice: Trying to get index of a non-array in %s on line 11 NULL + +Notice: Trying to get index of a non-array in %s on line 14 NULL + +Notice: Trying to get index of a non-array in %s on line 17 NULL + +Notice: Trying to get index of a non-array in %s on line 20 NULL Done diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 76a2f21ce3c33..a7a60b25733e2 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1852,6 +1852,9 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z } } } else { + if (type != BP_VAR_IS) { + zend_error(E_NOTICE, "Trying to get index of a non-array"); + } ZVAL_NULL(result); } } diff --git a/ext/gmp/tests/gmp_sqrtrem.phpt b/ext/gmp/tests/gmp_sqrtrem.phpt index 2fca463daa19a..9f12d32f7eea7 100644 --- a/ext/gmp/tests/gmp_sqrtrem.phpt +++ b/ext/gmp/tests/gmp_sqrtrem.phpt @@ -60,9 +60,13 @@ echo "Done\n"; --EXPECTF-- Warning: gmp_sqrtrem(): Number has to be greater than or equal to 0 in %s on line %d +Notice: Trying to get index of a non-array in %s on line 4 + Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) +Notice: Trying to get index of a non-array in %s on line 5 + Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) string(1) "0" @@ -84,9 +88,13 @@ string(1) "1" Warning: gmp_sqrtrem(): Number has to be greater than or equal to 0 in %s on line %d +Notice: Trying to get index of a non-array in %s on line 42 + Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) +Notice: Trying to get index of a non-array in %s on line 43 + Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) string(4) "1000" diff --git a/ext/mysqli/tests/mysqli_fork.phpt b/ext/mysqli/tests/mysqli_fork.phpt index f5a0b7bc95083..42b06ad762a17 100644 --- a/ext/mysqli/tests/mysqli_fork.phpt +++ b/ext/mysqli/tests/mysqli_fork.phpt @@ -111,6 +111,14 @@ if (!have_innodb($link)) continue; $tmp = mysqli_fetch_assoc($pres); mysqli_free_result($pres); + + if (!is_array($tmp)) { + $tmp = array( + 'msg_id' => null, + 'msg' => null, + ); + } + if ($tmp['msg_id'] == $msg_id) /* no new message */ continue; @@ -143,6 +151,14 @@ if (!have_innodb($link)) $wait_id = pcntl_waitpid($pid, $status, WNOHANG); if ($pres = mysqli_query($plink, $sql)) { $row = mysqli_fetch_assoc($pres); + + if (!is_array($row)) { + $row = array( + 'msg_id' => null, + 'msg' => null, + ); + } + if ($row['msg_id'] != $last_msg_id) { $last_msg_id = $row['msg_id']; switch ($row['msg']) { diff --git a/ext/simplexml/tests/017.phpt b/ext/simplexml/tests/017.phpt index 776b00c785440..b4d6155916cc0 100644 --- a/ext/simplexml/tests/017.phpt +++ b/ext/simplexml/tests/017.phpt @@ -75,12 +75,24 @@ person: Boe ---22--- person: Joe child: Ann + +Notice: Trying to get index of a non-array in %s on line 37 child: + +Notice: Trying to get index of a non-array in %s on line 34 person: Notice: Trying to get property of non-object in %s017.php on line %d + +Notice: Trying to get index of a non-array in %s on line 37 + +Notice: Trying to get index of a non-array in %s on line 37 child: -Notice: Trying to get property of non-object in %s017.php on line %d +Notice: Trying to get property of non-object in %s on line %d + +Notice: Trying to get index of a non-array in %s on line 37 + +Notice: Trying to get index of a non-array in %s on line 37 child: ===DONE=== diff --git a/ext/spl/tests/array_026.phpt b/ext/spl/tests/array_026.phpt index 9c79c57b660f4..b48468eaca8e5 100644 --- a/ext/spl/tests/array_026.phpt +++ b/ext/spl/tests/array_026.phpt @@ -9,6 +9,8 @@ var_dump($test, $test3['mmmmm']); ?> --EXPECTF-- Notice: Undefined variable: test3 in %s%earray_026.php on line %d + +Notice: Trying to get index of a non-array in %s on line 5 object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(1) { diff --git a/ext/spl/tests/bug62978.phpt b/ext/spl/tests/bug62978.phpt index 5c55507ad9906..06797c2df967f 100644 --- a/ext/spl/tests/bug62978.phpt +++ b/ext/spl/tests/bug62978.phpt @@ -32,6 +32,8 @@ Notice: Undefined index: epic_magic in %sbug62978.php on line %d NULL Notice: Undefined variable: c in %sbug62978.php on line %d + +Notice: Trying to get index of a non-array in %s on line 10 NULL Notice: Undefined index: epic_magic in %sbug62978.php on line %d diff --git a/ext/standard/tests/array/bug31158.phpt b/ext/standard/tests/array/bug31158.phpt index da7a9ec907267..1dd25530f44d1 100644 --- a/ext/standard/tests/array/bug31158.phpt +++ b/ext/standard/tests/array/bug31158.phpt @@ -15,5 +15,7 @@ echo "ok\n"; ?> --EXPECTF-- Notice: Undefined variable: GLOBALS in %sbug31158.php on line 6 + +Notice: Trying to get index of a non-array in %s on line 6 ok diff --git a/sapi/fpm/tests/fcgi.inc b/sapi/fpm/tests/fcgi.inc index b31676260dac6..d76ec818590be 100644 --- a/sapi/fpm/tests/fcgi.inc +++ b/sapi/fpm/tests/fcgi.inc @@ -534,16 +534,18 @@ class Client do { $resp = $this->readPacket(); - if ($resp['type'] == self::STDOUT || $resp['type'] == self::STDERR) { - if ($resp['type'] == self::STDERR) { - $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_ERR; + if ($resp !== false) { + if ($resp['type'] == self::STDOUT || $resp['type'] == self::STDERR) { + if ($resp['type'] == self::STDERR) { + $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_ERR; + } + $this->_requests[$resp['requestId']]['response'] .= $resp['content']; } - $this->_requests[$resp['requestId']]['response'] .= $resp['content']; - } - if ($resp['type'] == self::END_REQUEST) { - $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_OK; - if ($resp['requestId'] == $requestId) { - break; + if ($resp['type'] == self::END_REQUEST) { + $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_OK; + if ($resp['requestId'] == $requestId) { + break; + } } } if (microtime(true) - $startTime >= ($timeoutMs * 1000)) { diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt index b0cfbe093120a..0fa7ff4823c2f 100644 --- a/tests/lang/bug24436.phpt +++ b/tests/lang/bug24436.phpt @@ -11,5 +11,5 @@ class test { $test1 = new test(); ?> ---EXPECT-- +--EXPECTF-- test1test2 diff --git a/tests/lang/bug25922.phpt b/tests/lang/bug25922.phpt index bb030c9df834c..c00782a89d591 100644 --- a/tests/lang/bug25922.phpt +++ b/tests/lang/bug25922.phpt @@ -20,4 +20,5 @@ test(); ?> --EXPECT-- Undefined variable: data +Trying to get index of a non-array Undefined index here: '' diff --git a/tests/lang/passByReference_003.phpt b/tests/lang/passByReference_003.phpt index bbbc564654d91..486a67d0bde4f 100644 --- a/tests/lang/passByReference_003.phpt +++ b/tests/lang/passByReference_003.phpt @@ -28,6 +28,8 @@ Passing undefined by value Notice: Undefined variable: undef1 in %s on line 13 +Notice: Trying to get index of a non-array in %s on line 13 + Inside passbyVal call: NULL