3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bla extends RecursiveFilterIterator { public function accept() { echo "Accept: "; var_dump(parent::current()); return true; } } $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); $bla = new Bla($rArrayIterator); foreach ($bla as $key1 => $value1) { if ($bla->hasChildren()) { foreach ($bla->getChildren() as $value) { var_dump($value); } } else { echo "no children\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of Bla::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/9465L on line 5 Accept: string(5) "test1" no children Accept: array(3) { [0]=> string(4) "tet3" [1]=> string(5) "test4" [2]=> string(5) "test5" } Accept: string(4) "tet3" string(4) "tet3" Accept: string(5) "test4" string(5) "test4" Accept: string(5) "test5" string(5) "test5"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.83 ms | 402 KiB | 8 Q