From b5bbf101b1013a394c8a9ef5832906335ad1b5b9 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sun, 10 May 2015 16:39:47 +0100 Subject: [PATCH 01/11] Fix #64194: NULL variable (and scalars) do not give error when trying to use as array --- Zend/tests/024.phpt | 32 ++++++++++++-------- Zend/tests/033.phpt | 42 ++++++++++++++++++++++---- Zend/tests/assign_to_var_003.phpt | 1 + Zend/tests/bug24436.phpt | 5 ++- Zend/tests/dereference_002.phpt | 2 ++ Zend/tests/dereference_010.phpt | 3 ++ Zend/tests/dereference_014.phpt | 4 +++ Zend/tests/isset_003.phpt | 8 +++++ Zend/tests/isset_003_2_4.phpt | 8 +++++ Zend/tests/offset_bool.phpt | 18 +++++++++++ Zend/tests/offset_long.phpt | 18 +++++++++++ Zend/tests/offset_null.phpt | 18 +++++++++++ Zend/zend_execute.c | 1 + ext/spl/tests/array_026.phpt | 2 ++ ext/spl/tests/bug62978.phpt | 2 ++ ext/standard/tests/array/bug31158.phpt | 2 ++ tests/lang/bug24436.phpt | 7 +++-- tests/lang/bug25922.phpt | 1 + tests/lang/passByReference_003.phpt | 2 ++ 19 files changed, 154 insertions(+), 22 deletions(-) diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt index f89c49e61380a..2d20a70ebfcfb 100644 --- a/Zend/tests/024.phpt +++ b/Zend/tests/024.phpt @@ -15,37 +15,43 @@ var_dump($a->$b->{$c[1]}); ?> --EXPECTF-- -Notice: Undefined variable: a in %s on line %d +Notice: Undefined variable: a in %s on line 3 + +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 4 + +Notice: Undefined variable: c in %s on line 4 -Notice: Undefined variable: %s in %s on line %d +Notice: Trying to get index of a non-array in %s on line 4 NULL -Notice: Undefined variable: a in %s on line %d +Notice: Undefined variable: a in %s on line 5 int(1) -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: a in %s on line 6 -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: b in %s on line 6 int(0) -Notice: Undefined variable: a in %s on line %d +Notice: Undefined variable: a in %s on line 7 NULL -Notice: Undefined variable: b in %s on line %d +Notice: Undefined variable: b in %s on line 8 int(1) -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 9 NULL -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 10 NULL -Notice: Undefined variable: c in %s on line %d +Notice: Undefined variable: c in %s on line 11 + +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 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 11 NULL diff --git a/Zend/tests/033.phpt b/Zend/tests/033.phpt index 17319e0d6105c..a419a02a64c0f 100644 --- a/Zend/tests/033.phpt +++ b/Zend/tests/033.phpt @@ -18,14 +18,44 @@ $arr[][]->bar = 2; ?> --EXPECTF-- -Notice: Undefined variable: arr in %s on line %d +Notice: Undefined variable: arr 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 3 -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 property of non-object in %s on line %d +Notice: Trying to get index of a non-array in %s on line 3 -Warning: Creating default object from empty value in %s on line %d +Notice: Trying to get index of a non-array in %s on line 3 -Warning: Creating default object from empty value in %s on line %d +Notice: Trying to get index of a non-array in %s on line 3 + +Notice: Undefined variable: arr 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: Trying to get index of a non-array in %s on line 5 + +Notice: Undefined variable: arr 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 index of a non-array in %s on line 7 + +Notice: Trying to get property of non-object in %s on line 7 + +Warning: Creating default object from empty value in %s on line 9 + +Warning: Creating default object from empty value in %s on line 13 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..c6e4c713bc6aa 100644 --- a/Zend/tests/bug24436.phpt +++ b/Zend/tests/bug24436.phpt @@ -17,8 +17,11 @@ class test { $test1 = new test(); ?> ---EXPECT-- +--EXPECTF-- +Notice: Trying to get index of a non-array in %s on line 4 test1 + +Notice: Trying to get index of a non-array in %s on line 5 test2 test1 test2 diff --git a/Zend/tests/dereference_002.phpt b/Zend/tests/dereference_002.phpt index da13decc396be..490e60dccb99f 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 6acda77ba84e5..eee1abc6e8950 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: Cannot use object of type stdClass as array in %s on line %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..3e502de4f5243 100644 --- a/Zend/tests/isset_003.phpt +++ b/Zend/tests/isset_003.phpt @@ -27,12 +27,20 @@ var_dump(isset($GLOBALS[1]->$GLOBALS)); bool(true) bool(true) bool(false) + +Notice: Trying to get index of a non-array in %s on line 12 + +Notice: Trying to get index of a non-array in %s on line 12 + +Notice: Trying to get index of a non-array in %s on line 12 bool(false) 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 14 + 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..822e0e674f1df 100644 --- a/Zend/tests/isset_003_2_4.phpt +++ b/Zend/tests/isset_003_2_4.phpt @@ -29,12 +29,20 @@ var_dump(isset($GLOBALS[1]->$GLOBALS)); bool(true) bool(true) bool(false) + +Notice: Trying to get index of a non-array in %s on line 12 + +Notice: Trying to get index of a non-array in %s on line 12 + +Notice: Trying to get index of a non-array in %s on line 12 bool(false) 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 14 + 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 26415b0d7cfc8..4a0e31bbac43d 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1640,6 +1640,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z container = Z_REFVAL_P(container); goto try_again; } else { + zend_error(E_NOTICE, "Trying to get index of a non-array"); ZVAL_NULL(result); } } 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/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt index b0cfbe093120a..32bffb0b86deb 100644 --- a/tests/lang/bug24436.phpt +++ b/tests/lang/bug24436.phpt @@ -11,5 +11,8 @@ class test { $test1 = new test(); ?> ---EXPECT-- -test1test2 +--EXPECTF-- +Notice: Trying to get index of a non-array in %s on line 4 +test1 +Notice: Trying to get index of a non-array in %s on line 5 +test2 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 From 00dab47b00d232b3a922db75bf820317911cb32b Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sun, 10 May 2015 20:13:41 +0100 Subject: [PATCH 02/11] Fix #64194 (gmp and fcgi tests) --- ext/gmp/tests/gmp_sqrtrem.phpt | 8 ++++++++ sapi/fpm/tests/fcgi.inc | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) 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/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)) { From a126396446d188c6d0d65d1cc020266cdab861d4 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sun, 10 May 2015 20:21:12 +0100 Subject: [PATCH 03/11] Fix #64194 (SimpleXML tests) --- ext/simplexml/tests/017.phpt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ext/simplexml/tests/017.phpt b/ext/simplexml/tests/017.phpt index 776b00c785440..6ae117052afa3 100644 --- a/ext/simplexml/tests/017.phpt +++ b/ext/simplexml/tests/017.phpt @@ -75,12 +75,23 @@ 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=== From 68f99a8b9476c1aeb0964be9156f7196c61b8177 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sun, 10 May 2015 20:57:45 +0100 Subject: [PATCH 04/11] Fix #64194 (SimpleXML tests) --- ext/simplexml/tests/017.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/simplexml/tests/017.phpt b/ext/simplexml/tests/017.phpt index 6ae117052afa3..b4d6155916cc0 100644 --- a/ext/simplexml/tests/017.phpt +++ b/ext/simplexml/tests/017.phpt @@ -75,6 +75,7 @@ person: Boe ---22--- person: Joe child: Ann + Notice: Trying to get index of a non-array in %s on line 37 child: From ad5afaf85c7d2688a110e4d8cb2b12d1cc8be618 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Mon, 11 May 2015 08:51:38 +0100 Subject: [PATCH 05/11] Fix #64194 (new array access on non-array tests - currently failing) --- Zend/tests/array_access_nonarray.phpt | 130 ++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 Zend/tests/array_access_nonarray.phpt diff --git a/Zend/tests/array_access_nonarray.phpt b/Zend/tests/array_access_nonarray.phpt new file mode 100644 index 0000000000000..cc2417576f57c --- /dev/null +++ b/Zend/tests/array_access_nonarray.phpt @@ -0,0 +1,130 @@ +--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"; + var_dump($a[0]); + var_dump($a[0][1]); + var_dump($a['foo']); + var_dump($a['foo']['bar']); + $b = isset($a[0]); + var_dump($b); + $b = isset($a[0][0]); + var_dump($b); + unset($a, $b); +} +--EXPECTF-- +--- null --- + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +NULL +bool(false) +bool(false) + + +--- int --- + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +NULL +bool(false) +bool(false) + + +--- float --- + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +NULL +bool(false) +bool(false) + + +--- bool --- + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +NULL + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 + +Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +NULL +bool(false) +bool(false) + + +--- string --- +string(1) "h" + +Notice: Uninitialized string offset: 1 in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +string(0) "" + +Warning: Illegal string offset 'foo' in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +string(1) "h" + +Warning: Illegal string offset 'foo' in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 + +Warning: Illegal string offset 'bar' in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +string(1) "h" +bool(true) +bool(true) + + +--- object --- + +Fatal error: Cannot use object of type stdClass as array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 From efc2e5a62218c6c1f93703fc627d1a923ac969d7 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Mon, 11 May 2015 19:29:23 +0100 Subject: [PATCH 06/11] Fix #64194 (possible fix for mysqli_fork.phpt) --- ext/mysqli/tests/mysqli_fork.phpt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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']) { From 6dd85f6ace02ec9c6a8666084f8514f16275fa87 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Mon, 11 May 2015 19:55:02 +0100 Subject: [PATCH 07/11] Fix #64194 (fixing isset handling) --- Zend/zend_execute.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 4a0e31bbac43d..db946ffc128e3 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1640,7 +1640,9 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z container = Z_REFVAL_P(container); goto try_again; } else { - zend_error(E_NOTICE, "Trying to get index of a non-array"); + if (type != BP_VAR_IS) { + zend_error(E_NOTICE, "Trying to get index of a non-array"); + } ZVAL_NULL(result); } } From 0349a85ef79150959e77c7e31ee9c7a64f143e5d Mon Sep 17 00:00:00 2001 From: AllenJB Date: Mon, 11 May 2015 22:23:59 +0100 Subject: [PATCH 08/11] Fix #64194 (fixing isset tests expectations) --- Zend/tests/array_access_nonarray.phpt | 58 +++++++++++++-------------- Zend/tests/bug24436.phpt | 3 -- Zend/tests/isset_003.phpt | 14 ------- Zend/tests/isset_003_2_4.phpt | 14 ------- tests/lang/bug24436.phpt | 2 - 5 files changed, 29 insertions(+), 62 deletions(-) diff --git a/Zend/tests/array_access_nonarray.phpt b/Zend/tests/array_access_nonarray.phpt index cc2417576f57c..18401a4310b5a 100644 --- a/Zend/tests/array_access_nonarray.phpt +++ b/Zend/tests/array_access_nonarray.phpt @@ -26,20 +26,20 @@ foreach ($values as $type => $a) { --EXPECTF-- --- null --- -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +Notice: Trying to get index of a non-array in %s on line 13 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +Notice: Trying to get index of a non-array in %s on line 14 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +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 /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +Notice: Trying to get index of a non-array in %s on line 15 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 NULL bool(false) bool(false) @@ -47,20 +47,20 @@ bool(false) --- int --- -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +Notice: Trying to get index of a non-array in %s on line 13 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +Notice: Trying to get index of a non-array in %s on line 14 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +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 /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +Notice: Trying to get index of a non-array in %s on line 15 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 NULL bool(false) bool(false) @@ -68,20 +68,20 @@ bool(false) --- float --- -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +Notice: Trying to get index of a non-array in %s on line 13 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +Notice: Trying to get index of a non-array in %s on line 14 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +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 /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +Notice: Trying to get index of a non-array in %s on line 15 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 NULL bool(false) bool(false) @@ -89,20 +89,20 @@ bool(false) --- bool --- -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +Notice: Trying to get index of a non-array in %s on line 13 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +Notice: Trying to get index of a non-array in %s on line 14 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +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 /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +Notice: Trying to get index of a non-array in %s on line 15 NULL -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 -Notice: Trying to get index of a non-array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Notice: Trying to get index of a non-array in %s on line 16 NULL bool(false) bool(false) @@ -111,15 +111,15 @@ bool(false) --- string --- string(1) "h" -Notice: Uninitialized string offset: 1 in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 14 +Notice: Uninitialized string offset: 1 in %s on line 14 string(0) "" -Warning: Illegal string offset 'foo' in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 15 +Warning: Illegal string offset 'foo' in %s on line 15 string(1) "h" -Warning: Illegal string offset 'foo' in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Warning: Illegal string offset 'foo' in %s on line 16 -Warning: Illegal string offset 'bar' in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 16 +Warning: Illegal string offset 'bar' in %s on line 16 string(1) "h" bool(true) bool(true) @@ -127,4 +127,4 @@ bool(true) --- object --- -Fatal error: Cannot use object of type stdClass as array in /home/allen/src/php-src/Zend/tests/array_access_nonarray.php on line 13 +Fatal error: Cannot use object of type stdClass as array in %s on line 13 diff --git a/Zend/tests/bug24436.phpt b/Zend/tests/bug24436.phpt index c6e4c713bc6aa..1ab97adf4e34b 100644 --- a/Zend/tests/bug24436.phpt +++ b/Zend/tests/bug24436.phpt @@ -18,10 +18,7 @@ class test { $test1 = new test(); ?> --EXPECTF-- -Notice: Trying to get index of a non-array in %s on line 4 test1 - -Notice: Trying to get index of a non-array in %s on line 5 test2 test1 test2 diff --git a/Zend/tests/isset_003.phpt b/Zend/tests/isset_003.phpt index 3e502de4f5243..d2c97fd27418f 100644 --- a/Zend/tests/isset_003.phpt +++ b/Zend/tests/isset_003.phpt @@ -27,21 +27,7 @@ var_dump(isset($GLOBALS[1]->$GLOBALS)); bool(true) bool(true) bool(false) - -Notice: Trying to get index of a non-array in %s on line 12 - -Notice: Trying to get index of a non-array in %s on line 12 - -Notice: Trying to get index of a non-array in %s on line 12 bool(false) - -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 14 - -Notice: Trying to get property of non-object in %s on line %d bool(false) bool(true) bool(false) diff --git a/Zend/tests/isset_003_2_4.phpt b/Zend/tests/isset_003_2_4.phpt index 822e0e674f1df..963349df2a3ea 100644 --- a/Zend/tests/isset_003_2_4.phpt +++ b/Zend/tests/isset_003_2_4.phpt @@ -29,21 +29,7 @@ var_dump(isset($GLOBALS[1]->$GLOBALS)); bool(true) bool(true) bool(false) - -Notice: Trying to get index of a non-array in %s on line 12 - -Notice: Trying to get index of a non-array in %s on line 12 - -Notice: Trying to get index of a non-array in %s on line 12 bool(false) - -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 14 - -Notice: Trying to get property of non-object in %s on line %d bool(false) bool(true) bool(false) diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt index 32bffb0b86deb..c05cd615ad50a 100644 --- a/tests/lang/bug24436.phpt +++ b/tests/lang/bug24436.phpt @@ -12,7 +12,5 @@ class test { $test1 = new test(); ?> --EXPECTF-- -Notice: Trying to get index of a non-array in %s on line 4 test1 -Notice: Trying to get index of a non-array in %s on line 5 test2 From d7af0b3eb1b0903df5b0574a91cd3d32ab788a3b Mon Sep 17 00:00:00 2001 From: AllenJB Date: Tue, 12 May 2015 09:04:03 +0100 Subject: [PATCH 09/11] Fix #64194 (fixing isset tests expectations) --- Zend/tests/isset_003.phpt | 8 ++++++++ Zend/tests/isset_003_2_4.phpt | 8 ++++++++ tests/lang/bug24436.phpt | 3 +-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Zend/tests/isset_003.phpt b/Zend/tests/isset_003.phpt index d2c97fd27418f..7d8e9ad58d11f 100644 --- a/Zend/tests/isset_003.phpt +++ b/Zend/tests/isset_003.phpt @@ -28,6 +28,14 @@ bool(true) bool(true) bool(false) bool(false) + +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) bool(false) diff --git a/Zend/tests/isset_003_2_4.phpt b/Zend/tests/isset_003_2_4.phpt index 963349df2a3ea..939c1ad443c10 100644 --- a/Zend/tests/isset_003_2_4.phpt +++ b/Zend/tests/isset_003_2_4.phpt @@ -30,6 +30,14 @@ bool(true) bool(true) bool(false) bool(false) + +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) bool(false) diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt index c05cd615ad50a..0fa7ff4823c2f 100644 --- a/tests/lang/bug24436.phpt +++ b/tests/lang/bug24436.phpt @@ -12,5 +12,4 @@ class test { $test1 = new test(); ?> --EXPECTF-- -test1 -test2 +test1test2 From 91710b3676df2b8fbedbe11afad896f3c38a0a19 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Tue, 12 May 2015 19:32:14 +0100 Subject: [PATCH 10/11] Fix #64194 (undo %d => specific line numbers in test EXPECTF sections) --- Zend/tests/024.phpt | 28 ++++++++++++++-------------- Zend/tests/033.phpt | 12 ++++++------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt index 2d20a70ebfcfb..a6aef5ffb9dc2 100644 --- a/Zend/tests/024.phpt +++ b/Zend/tests/024.phpt @@ -15,43 +15,43 @@ var_dump($a->$b->{$c[1]}); ?> --EXPECTF-- -Notice: Undefined variable: a in %s on line 3 +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: a in %s on line 4 +Notice: Undefined variable: a in %s on line %d -Notice: Undefined variable: c in %s on line 4 +Notice: Undefined variable: c in %s on line %d -Notice: Trying to get index of a non-array in %s on line 4 +Notice: Trying to get index of a non-array in %s on line %d NULL -Notice: Undefined variable: a in %s on line 5 +Notice: Undefined variable: a in %s on line %d int(1) -Notice: Undefined variable: a in %s on line 6 +Notice: Undefined variable: a in %s on line %d -Notice: Undefined variable: b in %s on line 6 +Notice: Undefined variable: b in %s on line %d int(0) -Notice: Undefined variable: a in %s on line 7 +Notice: Undefined variable: a in %s on line %d NULL -Notice: Undefined variable: b in %s on line 8 +Notice: Undefined variable: b in %s on line %d int(1) -Notice: Trying to get property of non-object in %s on line 9 +Notice: Trying to get property of non-object in %s on line %d NULL -Notice: Trying to get property of non-object in %s on line 10 +Notice: Trying to get property of non-object in %s on line %d NULL -Notice: Undefined variable: c in %s on line 11 +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 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 11 +Notice: Trying to get property of non-object in %s on line %d NULL diff --git a/Zend/tests/033.phpt b/Zend/tests/033.phpt index a419a02a64c0f..60792b9aff59d 100644 --- a/Zend/tests/033.phpt +++ b/Zend/tests/033.phpt @@ -18,7 +18,7 @@ $arr[][]->bar = 2; ?> --EXPECTF-- -Notice: Undefined variable: arr 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 3 @@ -30,7 +30,7 @@ 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 5 +Notice: Undefined variable: arr in %s on line %d Notice: Trying to get index of a non-array in %s on line 5 @@ -42,7 +42,7 @@ 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 7 +Notice: Undefined variable: arr in %s on line %d Notice: Trying to get index of a non-array in %s on line 7 @@ -54,8 +54,8 @@ 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 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 9 +Warning: Creating default object from empty value in %s on line %d -Warning: Creating default object from empty value in %s on line 13 +Warning: Creating default object from empty value in %s on line %d From d88e48c6df61c680db5af600b5217f9b538880e2 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Wed, 26 Aug 2015 10:12:26 +0100 Subject: [PATCH 11/11] Fix #64194: Update tests to explicitly include object properties and function return values --- Zend/tests/array_access_nonarray.phpt | 421 +++++++++++++++++++++++--- 1 file changed, 384 insertions(+), 37 deletions(-) diff --git a/Zend/tests/array_access_nonarray.phpt b/Zend/tests/array_access_nonarray.phpt index 18401a4310b5a..29ad5a8e35fc3 100644 --- a/Zend/tests/array_access_nonarray.phpt +++ b/Zend/tests/array_access_nonarray.phpt @@ -13,33 +13,156 @@ $values = array( foreach ($values as $type => $a) { print "\n\n--- {$type} ---\n"; - var_dump($a[0]); - var_dump($a[0][1]); - var_dump($a['foo']); - var_dump($a['foo']['bar']); - $b = isset($a[0]); - var_dump($b); - $b = isset($a[0][0]); - var_dump($b); + 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 13 +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 14 +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 14 +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 15 +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 16 +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 16 +Notice: Trying to get index of a non-array in %s on line 32 NULL bool(false) bool(false) @@ -47,20 +170,20 @@ bool(false) --- int --- -Notice: Trying to get index of a non-array in %s on line 13 +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 14 +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 14 +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 15 +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 16 +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 16 +Notice: Trying to get index of a non-array in %s on line 32 NULL bool(false) bool(false) @@ -68,20 +191,20 @@ bool(false) --- float --- -Notice: Trying to get index of a non-array in %s on line 13 +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 14 +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 14 +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 15 +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 16 +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 16 +Notice: Trying to get index of a non-array in %s on line 32 NULL bool(false) bool(false) @@ -89,20 +212,20 @@ bool(false) --- bool --- -Notice: Trying to get index of a non-array in %s on line 13 +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 14 +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 14 +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 15 +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 16 +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 16 +Notice: Trying to get index of a non-array in %s on line 32 NULL bool(false) bool(false) @@ -111,20 +234,244 @@ bool(false) --- string --- string(1) "h" -Notice: Uninitialized string offset: 1 in %s on line 14 +Notice: Uninitialized string offset: 1 in %s on line 20 string(0) "" -Warning: Illegal string offset 'foo' in %s on line 15 +Warning: Illegal string offset 'foo' in %s on line 26 string(1) "h" -Warning: Illegal string offset 'foo' in %s on line 16 +Warning: Illegal string offset 'foo' in %s on line 32 -Warning: Illegal string offset 'bar' in %s on line 16 +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) + -Fatal error: Cannot use object of type stdClass as array in %s on line 13 +--- 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