3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = array("Lemony & Fresh","Orange Twist","Apple Juice"); print_r($fruits); echo '<br />'; function name_base($key) { $name2 = str_replace(" ", "_", $key); $name3 = str_replace("&", "and", $name2); $name4 = strtolower($name3); echo $name4.'<br />'; return $name4; } echo '<br />'; $test = array_map('name_base', $fruits); $fruits_fixed = $test; echo '<br />'; print_r($fruits_fixed);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Lemony & Fresh [1] => Orange Twist [2] => Apple Juice ) <br /><br />lemony_and_fresh<br />orange_twist<br />apple_juice<br /><br />Array ( [0] => lemony_and_fresh [1] => orange_twist [2] => apple_juice )

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