3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array ( 'apple' => 'some code', 'beta' => 'other code', 'cat' => 'other code 2' ); $next_array = array(); foreach ($array as $key=>$val){ $next_array[str_replace('e','!',$key)] = $val; } print_r($next_array);
Output for 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.14, 8.4.16 - 8.4.18, 8.5.0 - 8.5.3
Array ( [appl!] => some code [b!ta] => other code [cat] => other code 2 )
Output for 8.4.15
/bin/php-8.4.15: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
Process exited with code 127.

preferences:
81.59 ms | 1113 KiB | 4 Q