- Fixed mess with CGI/CLI -d option (now it works with cgi; constants are
working exactly like in php.ini; with FastCGI -d affects all requests).
(Dmitry)
+- Fixed bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; segfaults).
+ (Dmitry)
- Fixed bug #39004 (Fixed generation of config.nice with autoconf 2.60).
(Ilia)
- Fixed bug #39003 (__autoload() is called for type hinting). (Dmitry, Tony)
--- /dev/null
+--TEST--
+Bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; segfaults)
+--FILE--
+<?php
+class A {}
+foreach(($a=(object)new A()) as $v);
+var_dump($a); // UNKNOWN:0
+?>
+--EXPECTF--
+object(A)#%d (0) {
+}
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (OP1_TYPE == IS_VAR &&
free_op1.var == NULL &&
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_CONST == IS_VAR &&
free_op1.var == NULL &&
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_TMP_VAR == IS_VAR &&
free_op1.var == NULL &&
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_VAR == IS_VAR &&
free_op1.var == NULL &&
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_CV == IS_VAR &&
free_op1.var == NULL &&