3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace itertools; function filter(\Traversable $iterator, callable $callback = null) { foreach ($iterator as $key => $val) { if (null !== $callback and $callback($val, $key)) { (yield $key => $val); } else if ($val) { (yield $key => $val); } } } $a = new \ArrayObject(["foo", "bar", 0, "baz"]); foreach (filter($a) as $val) { print_r($val); }
Output for git.master, git.master_jit, rfc.property-hooks
foobarbaz

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:
66.23 ms | 401 KiB | 8 Q