3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testArray = ['a' => ['b' => 'l'], 'c' => 'm', 'd' => ['n' => 'o']]; $actionArray = ['action' => ['b']]; function toUpperRecursive(array $arr) { foreach ($arr as $key => $val) { if (is_array($val)) { $newKey = strtoupper($key); $arr[$newKey] = toUpperRecursive($val); unset($arr[$key]); } elseif (is_string($val)) { // $arr[$key] = strtoupper($val); echo $val; } } return $arr; } echo "before:\n"; var_export($testArray); echo "after:\n"; var_export(toUpperRecursive($testArray));
Output for git.master, git.master_jit, rfc.property-hooks
before: array ( 'a' => array ( 'b' => 'l', ), 'c' => 'm', 'd' => array ( 'n' => 'o', ), )after: lmoarray ( 'c' => 'm', 'A' => array ( 'b' => 'l', ), 'D' => array ( 'n' => 'o', ), )

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.82 ms | 401 KiB | 8 Q