3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); $rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^(t)e(s)t/', RecursiveRegexIterator::ALL_MATCHES, 0, PREG_PATTERN_ORDER); foreach ($rRegexIterator as $key1 => $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"; var_dump($rRegexIterator->current()); } }
Output for git.master, git.master_jit, rfc.property-hooks
No children array(3) { [0]=> array(1) { [0]=> string(4) "test" } [1]=> array(1) { [0]=> string(1) "t" } [2]=> array(1) { [0]=> string(1) "s" } } Children: array(3) { [0]=> array(1) { [0]=> string(4) "test" } [1]=> array(1) { [0]=> string(1) "t" } [2]=> array(1) { [0]=> string(1) "s" } } array(3) { [0]=> array(1) { [0]=> string(4) "test" } [1]=> array(1) { [0]=> string(1) "t" } [2]=> array(1) { [0]=> string(1) "s" } }

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