3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['value', 'value', ['array 1', 'array 1', ['array 2']], ['array with more depth', ['array deep', ['array deeper']]] ]; function my_print($array) { $output = "<ul>"; foreach ($array as $value) { if (is_array($value)) { $output .= "<li>".my_print($value)."</li>"; } else { $output .= "<li>".$value."</li>"; } } $output .= "</ul>"; return $output; } echo my_print($array);
Output for git.master, git.master_jit, rfc.property-hooks
<ul><li>value</li><li>value</li><li><ul><li>array 1</li><li>array 1</li><li><ul><li>array 2</li></ul></li></ul></li><li><ul><li>array with more depth</li><li><ul><li>array deep</li><li><ul><li>array deeper</li></ul></li></ul></li></ul></li></ul>

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:
31.66 ms | 406 KiB | 5 Q