diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/tests/bug53971.phpt | 11 | ||||
-rw-r--r-- | Zend/zend_execute.c | 2 |
3 files changed, 14 insertions, 1 deletions
@@ -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; |