]> granicus.if.org Git - php/commitdiff
Fixed bug #73303
authorNikita Popov <nikic@php.net>
Fri, 18 Nov 2016 20:41:10 +0000 (21:41 +0100)
committerNikita Popov <nikic@php.net>
Fri, 18 Nov 2016 20:41:43 +0000 (21:41 +0100)
NEWS
Zend/zend_execute_API.c
ext/standard/tests/assert/bug73303.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index cc0c4869c10f06cd12f4bed99101bcb7563ebf05..f677e80f7dedf973a8363d577bd846037064836a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,9 +16,9 @@ PHP                                                                        NEWS
 - Mbstring:
   . Fixed bug #73532 (Null pointer dereference in mb_eregi). (Laruence)
 
-- Mysqlnd:\r
-  . Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)\r
-\r
+- Mysqlnd:
+  . Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)
+
 - Opcache:
   . Fixed bug #69090 (check cached files permissions)
 
@@ -27,8 +27,9 @@ PHP                                                                        NEWS
   . Fixed bug #73530 (Unsetting result set may reset other result set). (cmb)
 
 - Standard:
-   . Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue).
-     (rowan dot collins at gmail dot com)
+  . Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue).
+    (rowan dot collins at gmail dot com)
+  . Fixed bug #73303 (Scope not inherited by eval in assert()). (nikic)
 
 - XML:
   . Fixed bug #72135 (malformed XML causes fault) (edgarsandi)
@@ -36,7 +37,7 @@ PHP                                                                        NEWS
 10 Nov 2016, PHP 7.1.0RC6
 
 - Core:
-  . Fixded bug #72736 (Slow performance when fetching large dataset with mysqli
+  . Fixed bug #72736 (Slow performance when fetching large dataset with mysqli
     / PDO). (Dmitry)
   . Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
     overflow). (cmb)
index fc4a39acb60a886b343430aee061125de01418cb..cba929a7fdab4f50e36785a83dad15dfb9f90ace 100644 (file)
@@ -1086,6 +1086,8 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
 
                EG(no_extensions)=1;
 
+               new_op_array->scope = zend_get_executed_scope();
+
                zend_try {
                        ZVAL_UNDEF(&local_retval);
                        zend_execute(new_op_array, &local_retval);
diff --git a/ext/standard/tests/assert/bug73303.phpt b/ext/standard/tests/assert/bug73303.phpt
new file mode 100644 (file)
index 0000000..57990ab
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Bug #73303: Scope not inherited by eval in assert()
+--FILE--
+<?php
+
+class Test {
+       public $prop;
+
+       public function main(){
+               assert('self::checkCacheKey(get_object_vars($this))');
+               echo 'Success';
+       }
+       private static function checkCacheKey($obj_properties){
+               return count($obj_properties) == 1;
+       }
+}
+
+$obj = new Test();
+$obj->main();
+
+?>
+--EXPECT--
+Success