Fixed bug #48912 (Namespace causes unexpected strict behaviour with extract())

This commit is contained in:
Dmitry Stogov 2009-07-28 12:35:27 +00:00
parent 421b6e0f2c
commit ff766c1de2
4 changed files with 27 additions and 3 deletions

2
NEWS
View file

@ -27,6 +27,8 @@
(Ilia)
- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context
option is an array). (David Zülke)
- Fixed bug #48912 (Namespace causes unexpected strict behaviour with
extract()). (Dmitry)
- Fixed bug #48899 (is_callable returns true even if method does not exist in
parent class). (Felipe)
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)

16
Zend/tests/bug48912.phpt Normal file
View file

@ -0,0 +1,16 @@
--TEST--
Bug #48912 (Namespace causes unexpected strict behaviour with extract())
--FILE--
<?php
namespace A;
function test()
{
extract(func_get_arg(0));
}
test(array('x' => 1));
echo "ok\n";
?>
--EXPECT--
ok

View file

@ -2662,7 +2662,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
} else {
zval *valptr;
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);

View file

@ -8278,7 +8278,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
} else {
zval *valptr;
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@ -22128,7 +22130,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
} else {
zval *valptr;
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);