mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Fixed bug #48912 (Namespace causes unexpected strict behaviour with extract())
This commit is contained in:
parent
421b6e0f2c
commit
ff766c1de2
4 changed files with 27 additions and 3 deletions
2
NEWS
2
NEWS
|
@ -27,6 +27,8 @@
|
||||||
(Ilia)
|
(Ilia)
|
||||||
- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context
|
- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context
|
||||||
option is an array). (David Zülke)
|
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
|
- Fixed bug #48899 (is_callable returns true even if method does not exist in
|
||||||
parent class). (Felipe)
|
parent class). (Felipe)
|
||||||
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)
|
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)
|
||||||
|
|
16
Zend/tests/bug48912.phpt
Normal file
16
Zend/tests/bug48912.phpt
Normal 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
|
|
@ -2662,7 +2662,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
|
||||||
} else {
|
} else {
|
||||||
zval *valptr;
|
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");
|
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||||
}
|
}
|
||||||
ALLOC_ZVAL(valptr);
|
ALLOC_ZVAL(valptr);
|
||||||
|
|
|
@ -8278,7 +8278,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||||
} else {
|
} else {
|
||||||
zval *valptr;
|
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");
|
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||||
}
|
}
|
||||||
ALLOC_ZVAL(valptr);
|
ALLOC_ZVAL(valptr);
|
||||||
|
@ -22128,7 +22130,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||||
} else {
|
} else {
|
||||||
zval *valptr;
|
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");
|
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||||
}
|
}
|
||||||
ALLOC_ZVAL(valptr);
|
ALLOC_ZVAL(valptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue