reference). (Nikita)
. Fixed bug #75242 (RecursiveArrayIterator doesn't have constants from parent
class). (Nikita)
+ . Fixed bug #73209 (RecursiveArrayIterator does not iterate object
+ properties). (Nikita)
04 Jan 2018, PHP 7.1.13
RETURN_FALSE;
}
+ if (Z_TYPE_P(entry) == IS_INDIRECT) {
+ entry = Z_INDIRECT_P(entry);
+ }
+
ZVAL_DEREF(entry);
RETURN_BOOL(Z_TYPE_P(entry) == IS_ARRAY || (Z_TYPE_P(entry) == IS_OBJECT && (intern->ar_flags & SPL_ARRAY_CHILD_ARRAYS_ONLY) == 0));
}
return;
}
+ if (Z_TYPE_P(entry) == IS_INDIRECT) {
+ entry = Z_INDIRECT_P(entry);
+ }
+
+ ZVAL_DEREF(entry);
if (Z_TYPE_P(entry) == IS_OBJECT) {
if ((intern->ar_flags & SPL_ARRAY_CHILD_ARRAYS_ONLY) != 0) {
return;
--- /dev/null
+--TEST--
+Bug #73209: RecursiveArrayIterator does not iterate object properties
+--FILE--
+<?php
+
+class hello {
+ public $props = array();
+ function __construct() {
+ $this->props = ['hello' => 5, 'props' => ['keyme' => ['test' => 5]]];
+ }
+}
+$data = new hello();
+
+$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($data), RecursiveIteratorIterator::SELF_FIRST);
+echo "Expect to see all keys in ->props here: \n";
+
+foreach($iterator as $k=>$v) {
+ echo $k . "\n";
+}
+
+?>
+--EXPECT--
+Expect to see all keys in ->props here:
+props
+hello
+props
+keyme
+test