From: Dmitry Stogov Date: Mon, 21 Sep 2009 13:32:10 +0000 (+0000) Subject: Fixed tests/lang/bug22592.phpt X-Git-Tag: php-5.2.12RC1~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=943d08ee0f3aed6727916ed707633b38c6956f56;p=php Fixed tests/lang/bug22592.phpt --- diff --git a/Zend/tests/bug41919.phpt b/Zend/tests/bug41919.phpt index 2c4f985ebb..0ac3276b07 100644 --- a/Zend/tests/bug41919.phpt +++ b/Zend/tests/bug41919.phpt @@ -8,6 +8,4 @@ $foo[3]->bar[1] = "bang"; echo "ok\n"; ?> --EXPECTF-- -Notice: Uninitialized string offset: 3 in %s on line %d - Fatal error: Cannot use string offset as an object in %sbug41919.php on line %d diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 6fe169784c..76913f53d3 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1132,7 +1132,8 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container break; } if (result) { - if (Z_LVAL_P(dim) < 0 || Z_STRLEN_P(container) <= Z_LVAL_P(dim)) { + if ((Z_LVAL_P(dim) < 0 || Z_STRLEN_P(container) <= Z_LVAL_P(dim)) && + (type == BP_VAR_R || type == BP_VAR_IS)) { zend_error(E_NOTICE, "Uninitialized string offset: %ld", Z_LVAL_P(dim)); } container = *container_ptr;