- Fixed htmlentities/htmlspecialchars not to accept partial multibyte
sequences. (Stas)
+- Fixed bug #42818 ($foo = clone(array()); leaks memory). (Dmitry)
- Fixed bug #42785 (json_encode() formats doubles according to locale rather
then following standard syntax). (Ilia)
- Fixed bug #42772 (Storing $this in a static var fails while handling a cast
--- /dev/null
+--TEST--
+Bug #42818 ($foo = clone(array()); leaks memory)
+--FILE--
+<?php
+$foo = clone(array());
+?>
+--EXPECTF--
+Warning: __clone method called on non-object in %sbug42818.php on line 2
+
zend_error(E_WARNING, "__clone method called on non-object");
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
- FREE_OP1_IF_VAR();
+ FREE_OP1();
ZEND_VM_NEXT_OPCODE();
}
zend_error(E_WARNING, "__clone method called on non-object");
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
-
+ zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
}