diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/tests/bug48912.phpt | 16 | ||||
-rw-r--r-- | Zend/zend_vm_def.h | 4 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 8 |
4 files changed, 27 insertions, 3 deletions
@@ -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) diff --git a/Zend/tests/bug48912.phpt b/Zend/tests/bug48912.phpt new file mode 100644 index 0000000000..dc021a2efc --- /dev/null +++ b/Zend/tests/bug48912.phpt @@ -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 diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 233574d2aa..dbf5e3af69 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -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); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 2c3e7875a4..43bc3abde5 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -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); |