From: Brian Shire Date: Tue, 19 Dec 2006 08:02:48 +0000 (+0000) Subject: -Fixed bug #30074 (apparent symbol table error with extract($blah, EXTR_REFS)) X-Git-Tag: RELEASE_1_0_0RC1~653 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b4c2e0458cf0e4e23d7fa97cb9e55d30bd3edc5;p=php -Fixed bug #30074 (apparent symbol table error with extract($blah, EXTR_REFS)) # appoligies, I did this in reverse (applied to PHP_5_2) I should have MFH. --- diff --git a/ext/standard/array.c b/ext/standard/array.c index a328fc5f72..7b429f93e7 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1492,7 +1492,7 @@ PHP_FUNCTION(extract) *orig_var = *entry; } else { - if (var_array->refcount > 1) { + if (var_array->refcount > 1 || *entry == EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); } else { (*entry)->is_ref = 1; diff --git a/ext/standard/tests/array/bug30074.phpt b/ext/standard/tests/array/bug30074.phpt new file mode 100644 index 0000000000..7720fe0006 --- /dev/null +++ b/ext/standard/tests/array/bug30074.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #30074 (EG(uninitialized_zval_ptr) gets set to reference using EXTR_REFS, affecting later values) +--FILE-- +$undefined), EXTR_REFS); +var_dump(array($a)); +echo "Done\n"; +?> +--EXPECT-- +array(1) { + [0]=> + NULL +} +Done