- Fixed bug #34156 (memory usage remains elevated after memory limit is
reached). (Ilia)
- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia)
+- Fixed bug #34137 (assigning array element by reference causes binary mess).
+ (Dmitry)
- Fixed bug #34103 (line numbering not maintained in dom document). (Rob)
- Fixed bug #34078 (Reflection API problems in methods with boolean or
null default values). (Tony)
--- /dev/null
+--TEST--
+Bug #34137 (assigning array element by reference causes binary mess)
+--FILE--
+<?php
+$arr1 = array('a1' => array('alfa' => 'ok'));
+$arr1 =& $arr1['a1'];
+echo '-'.$arr1['alfa']."-\n";
+?>
+--EXPECT--
+-ok-
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else if (variable_ptr != value_ptr) {
- variable_ptr->refcount--;
- if (variable_ptr->refcount==0) {
- zendi_zval_dtor(*variable_ptr);
- FREE_ZVAL(variable_ptr);
- }
-
if (!PZVAL_IS_REF(value_ptr)) {
/* break it away */
value_ptr->refcount--;
*variable_ptr_ptr = value_ptr;
value_ptr->refcount++;
+
+ variable_ptr->refcount--;
+ if (variable_ptr->refcount==0) {
+ zendi_zval_dtor(*variable_ptr);
+ FREE_ZVAL(variable_ptr);
+ }
} else if (!variable_ptr->is_ref) {
if (variable_ptr_ptr == value_ptr_ptr) {
SEPARATE_ZVAL(variable_ptr_ptr);