3v4l.org

run code in 500+ PHP versions simultaneously
<?php $map = [ 'foo' => 'bar', 'foobar' => 'foo', ]; $input = 'foobar and foo'; echo str_replace(array_keys($map), array_values($map), $input); // Output: "bar bar and bar" echo strtr($input, $map); // Output: "baz and bar"

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.80.0230.00516.54

preferences:
54.1 ms | 480 KiB | 5 Q