From b84967d3e2c85e2b20f86cf3cb05b10ea53cc939 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 14 Feb 2011 08:46:53 +0000 Subject: [PATCH] Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime error) --- Zend/tests/bug53971.phpt | 11 +++++++++++ Zend/zend_execute.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug53971.phpt 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-- + +--EXPECT-- +bool(false) + + diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 26de484f58..264ecefc14 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -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 { -- 2.40.0