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.90.0050.00316.82
8.5.80.0230.00516.54
8.5.70.0040.00418.60
8.4.240.0130.00719.34
8.4.230.0030.00721.34
8.4.220.0190.00521.22
8.4.90.0040.00519.55
8.3.330.0100.01018.31
8.3.320.0100.00020.07
8.3.180.0060.00316.58
8.3.50.0040.00616.65
8.2.320.0040.00618.10

preferences:
40.82 ms | 525 KiB | 5 Q