]> granicus.if.org Git - php/commitdiff
Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime error)
authorDmitry Stogov <dmitry@php.net>
Mon, 14 Feb 2011 08:46:53 +0000 (08:46 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 14 Feb 2011 08:46:53 +0000 (08:46 +0000)
Zend/tests/bug53971.phpt [new file with mode: 0644]
Zend/zend_execute.c

diff --git a/Zend/tests/bug53971.phpt b/Zend/tests/bug53971.phpt
new file mode 100644 (file)
index 0000000..a1e66cc
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+Bug #53971 (isset() and empty() produce apparently spurious runtime error)
+--FILE--
+<?php
+$s = "";
+var_dump(isset($s[0][0]));
+?>
+--EXPECT--
+bool(false)
+
+
index 26de484f58febbbf6595b5958d23b9cc104480e0..264ecefc14fb34e389685d689c1f9187d1a336e9 100644 (file)
@@ -1258,7 +1258,9 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
                                Z_TYPE_P(ptr) = IS_STRING;
 
                                if (Z_LVAL_P(dim) < 0 || Z_STRLEN_P(container) <= Z_LVAL_P(dim)) {
-                                       zend_error(E_NOTICE, "Uninitialized string offset: %ld", Z_LVAL_P(dim));
+                                       if (type != BP_VAR_IS) {
+                                               zend_error(E_NOTICE, "Uninitialized string offset: %ld", Z_LVAL_P(dim));
+                                       }
                                        Z_STRVAL_P(ptr) = STR_EMPTY_ALLOC();
                                        Z_STRLEN_P(ptr) = 0;
                                } else {