dmitry                                   Tue, 28 Jul 2009 12:35:27 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=286452

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

Bug: http://bugs.php.net/48912 (Assigned) Namespace causes unexpected strict 
behaviour with extract()
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    A   php/php-src/branches/PHP_5_3/Zend/tests/bug48912.phpt
    U   php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
    U   php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2009-07-28 12:26:16 UTC (rev 286451)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-07-28 12:35:27 UTC (rev 286452)
@@ -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)

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug48912.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/tests/bug48912.phpt                       
        (rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug48912.phpt       2009-07-28 
12:35:27 UTC (rev 286452)
@@ -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

Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h     2009-07-28 12:26:16 UTC 
(rev 286451)
+++ php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h     2009-07-28 12:35:27 UTC 
(rev 286452)
@@ -2662,7 +2662,9 @@
        } 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);

Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-07-28 12:26:16 UTC 
(rev 286451)
+++ php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-07-28 12:35:27 UTC 
(rev 286452)
@@ -8278,7 +8278,9 @@
        } 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 @@
        } 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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to