3v4l.org

run code in 300+ PHP versions simultaneously
<?php function path_components($path) { $components = array(); while ($path != "." && $path != "/") { array_unshift($components, basename($path)); $path = dirname($path); } if ($path == "/") array_unshift($components, "/"); return $components; } function path_relative_to($path, $rel) { $path_components = path_components($path); $copy = $path_components; $rel_components = path_components($rel); for($i = 0 ; $i < count($rel_components ; ++$i)) { if ($path_components[$i] == $rel[$i]) array_shift($copy); else break; } return $copy; } var_dump(path_relative_to("/a/b/c", "/"));

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)
5.4.110.0090.04113.15
5.4.100.0110.04113.16
5.4.90.0080.04113.16
5.4.80.0110.04213.16
5.4.70.0100.04113.17
5.4.60.0070.04313.13
5.4.50.0120.04013.13
5.4.40.0120.04213.10
5.4.30.0100.05013.14
5.4.20.0080.04313.14
5.4.10.0130.03913.10
5.4.00.0110.04312.58
5.3.210.0110.05013.15
5.3.200.0090.04813.15
5.3.190.0100.05013.21
5.3.180.0090.04613.20
5.3.170.0090.04513.14
5.3.160.0110.04313.14
5.3.150.0110.04113.14
5.3.140.0100.04113.13
5.3.130.0090.04913.09
5.3.120.0120.05013.09
5.3.110.0130.04613.15
5.3.100.0120.04512.61
5.3.90.0090.04912.60
5.3.80.0100.04312.63
5.3.70.0100.04412.58
5.3.60.0100.04712.58
5.3.50.0070.04712.55
5.3.40.0100.04712.52
5.3.30.0090.05112.46
5.3.20.0110.04812.26
5.3.10.0110.04612.23
5.3.00.0090.04912.20

preferences:
139.78 ms | 1394 KiB | 7 Q