3v4l.org

run code in 300+ PHP versions simultaneously
<?php function collapse($path, $collapse, &$result) { foreach($collapse AS $key => $value) { if(is_array($value)) { collapse($path . $key . "/", $value, $result); continue; } $result[] = $path . $value; } } $result = array(); $toCollapse = array( "bla.tif", "quux.tif", array("foo" => array("bar" => array("lorem" => array("ipsum.tif", "doler.tif")))), array("bar" => array("qux" => array("baz" => array("ipsum.tif", "ufo.tif")))) ); collapse("", $toCollapse, $result); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => bla.tif [1] => quux.tif [2] => 2/foo/bar/lorem/ipsum.tif [3] => 2/foo/bar/lorem/doler.tif [4] => 3/bar/qux/baz/ipsum.tif [5] => 3/bar/qux/baz/ufo.tif )

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