- Fixed building of pdo_sqlite without sqlite3. (Scott)
+- Fixed bug #47165 (Possible memory corruption when passing return value by
+ reference). (Dmitry)
- Fixed bug #47145 + #47159 (Always free failed SQLite statements). (Scott)
- Fixed bug #47141 (Unable to fetch error messages from SQLite
when the database can't be opened). (Scott)
--- /dev/null
+--TEST--
+Bug #47165 (Possible memory corruption when passing return value by reference)
+--FILE--
+<?php
+class Foo {
+ var $bar = array();
+
+ static function bar() {
+ static $instance = null;
+ $instance = new Foo();
+ return $instance->bar;
+ }
+}
+extract(Foo::bar());
+echo "ok\n";
+?>
+--EXPECTF--
+
+Strict Standards: Only variables should be passed by reference in %sbug47165.php on line 11
+ok
if (function_ptr) {
if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
- op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
- send_by_reference = 0;
+ if (param->op_type & (IS_VAR|IS_CV)) {
+ send_by_reference = 1;
+ if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) {
+ /* Method call */
+ op = ZEND_SEND_VAR_NO_REF;
+ send_function = ZEND_ARG_SEND_FUNCTION;
+ }
+ } else {
+ op = ZEND_SEND_VAL;
+ send_by_reference = 0;
+ }
} else {
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
}
?>
--EXPECTF--
*** Testing for object ***
+
+Strict Standards: Only variables should be passed by reference in %sextract_variation9.php on line 10
int(1)
Done