summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2011-02-14 08:46:53 +0000
committerDmitry Stogov <dmitry@php.net>2011-02-14 08:46:53 +0000
commitac057c610cbdce68ed3de5d7e4dfd5907dcb6f49 (patch)
tree76464bab66477938c524b4cdff740e1be3ca636e
parentf87e92860a241f5801855922928203dc5afd7ee7 (diff)
downloadphp-git-ac057c610cbdce68ed3de5d7e4dfd5907dcb6f49.tar.gz
Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime error)
-rw-r--r--NEWS2
-rw-r--r--Zend/tests/bug53971.phpt11
-rw-r--r--Zend/zend_execute.c2
3 files changed, 14 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 46b17377f7..72c83eae11 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@
. Indirect reference to $this fails to resolve if direct $this is never used
in method. (Scott)
. Added options to debug backtrace functions. (Stas)
+ . Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime
+ error). (Dmitry)
. Fixed Bug #53629 (memory leak inside highlight_string()). (Hannes, Ilia)
. Fixed Bug #51458 (Lack of error context with nested exceptions). (Stas)
. Fixed Bug #47143 (Throwing an exception in a destructor causes a fatal
diff --git a/Zend/tests/bug53971.phpt b/Zend/tests/bug53971.phpt
new file mode 100644
index 0000000000..a1e66cc51e
--- /dev/null
+++ b/Zend/tests/bug53971.phpt
@@ -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)
+
+
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 7a1a7c6e62..e270816d8b 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1067,7 +1067,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
dim = &tmp;
}
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_IS) {
zend_error(E_NOTICE, "Uninitialized string offset: %ld", Z_LVAL_P(dim));
}
result->str_offset.str = container;