. Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence)
- Standard:
+ . Fixed bug #72622 (array_walk + array_replace_recursive create references
+ from nothing). (Laruence)
. Fixed bug #72152 (base64_decode $strict fails to detect null byte).
(Lauri Kenttä)
. Fixed bug #72263 (base64_decode skips a character after padding in strict
if (!was_ref && Z_ISREF(args[0])) {
/* copy reference back */
zval garbage;
-
+ if (Z_REFCOUNT(args[0]) == 1) {
+ ZVAL_UNREF(&args[0]);
+ }
ZVAL_COPY_VALUE(&garbage, zv);
ZVAL_COPY_VALUE(zv, &args[0]);
zval_ptr_dtor(&garbage);
--- /dev/null
+--TEST--
+Bug #72622 (array_walk + array_replace_recursive create references from nothing)
+--FILE--
+<?php
+
+function walk (array $arr) {
+ array_walk($arr, function (&$val, $name) {
+
+ });
+
+ return $arr;
+}
+
+$arr3 = ['foo' => 'foo'];
+$arr4 = walk(['foo' => 'bar']);
+$arr5 = array_replace_recursive($arr3, $arr4);
+$arr5['foo'] = 'baz';
+
+var_dump($arr3, $arr4, $arr5);
+
+?>
+--EXPECT--
+array(1) {
+ ["foo"]=>
+ string(3) "foo"
+}
+array(1) {
+ ["foo"]=>
+ string(3) "bar"
+}
+array(1) {
+ ["foo"]=>
+ string(3) "baz"
+}