3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rArrayIterator = new RecursiveArrayIterator(array('test1', array('test3', 'test4', 'test5'))); $rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^test/', RecursiveRegexIterator::ALL_MATCHES); foreach ($rRegexIterator as $key1 => $value1) { var_dump($key1); var_dump($value1); if ($rRegexIterator->hasChildren()) { // print all children echo "Children: "; foreach ($rRegexIterator->getChildren() as $key => $value) { var_dump($value); } echo "\n"; } else { echo "No children\n"; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
int(0) array(1) { [0]=> array(1) { [0]=> string(4) "test" } } No children int(1) array(3) { [0]=> string(5) "test3" [1]=> string(5) "test4" [2]=> string(5) "test5" } Children: array(1) { [0]=> array(1) { [0]=> string(4) "test" } } array(1) { [0]=> array(1) { [0]=> string(4) "test" } } array(1) { [0]=> array(1) { [0]=> string(4) "test" } }

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:
38.35 ms | 402 KiB | 8 Q