3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "/companies/(\d+)/adverts/new/(\d+)"; $replace = array(2223, 'generic'); $result = preg_replace_callback('#'.$string.'#', function($m) uses ($replace) { return 'h'; }, $string); var_dump($result);

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.260.0130.07318.95
5.4.250.0030.07318.97
5.4.240.0030.05318.90
5.4.230.0130.04318.97
5.4.220.0030.05718.88
5.4.210.0070.06018.75
5.4.200.0200.05018.95
5.4.190.0170.04718.77
5.4.180.0100.05718.93
5.4.170.0200.04318.59
5.4.160.0130.07318.74
5.4.150.0000.07718.91
5.4.140.0100.05016.40
5.4.130.0100.05016.55
5.4.120.0070.05016.31
5.4.110.0070.05316.50
5.4.100.0070.05316.35
5.4.90.0130.05316.28
5.4.80.0100.04716.45
5.4.70.0100.06716.43
5.4.60.0100.06716.29
5.4.50.0100.06016.32
5.4.40.0200.06016.39
5.4.30.0070.05716.27
5.4.20.0130.05016.50
5.4.10.0130.05016.33
5.4.00.0100.05316.06
5.3.280.0030.05314.56
5.3.270.0130.06714.60
5.3.260.0130.05314.82
5.3.250.0070.05014.68
5.3.240.0030.05714.57
5.3.230.0130.06714.82
5.3.220.0100.05314.65
5.3.210.0070.05314.47
5.3.200.0100.05314.40
5.3.190.0170.04314.64
5.3.180.0070.07314.70
5.3.170.0130.04714.64
5.3.160.0170.05014.46
5.3.150.0070.05314.46
5.3.140.0170.06714.64
5.3.130.0130.07314.64
5.3.120.0100.06014.56
5.3.110.0230.04314.71
5.3.100.0130.04714.04
5.3.90.0100.06014.02
5.3.80.0100.07014.00
5.3.70.0170.05313.98
5.3.60.0100.05014.07
5.3.50.0030.07713.97
5.3.40.0130.06314.13
5.3.30.0070.06713.73
5.3.20.0030.05713.71
5.3.10.0100.07713.64
5.3.00.0100.05713.54
5.2.170.0000.05011.16
5.2.160.0070.04311.25
5.2.150.0070.06011.14
5.2.140.0130.04311.29
5.2.130.0030.06011.10
5.2.120.0100.03311.12
5.2.110.0130.04311.03
5.2.100.0070.03711.10
5.2.90.0100.04011.20
5.2.80.0100.03711.24
5.2.70.0000.04711.02
5.2.60.0200.03010.97
5.2.50.0170.03311.03
5.2.40.0100.03710.91
5.2.30.0000.05010.99
5.2.20.0030.05710.89
5.2.10.0070.05711.07
5.2.00.0100.05310.48
5.1.60.0000.03710.09
5.1.50.0130.0379.94
5.1.40.0070.04710.13
5.1.30.0030.03710.23
5.1.20.0000.04710.23
5.1.10.0100.04010.16
5.1.00.0070.03310.26
5.0.50.0070.0338.56
5.0.40.0030.0308.56
5.0.30.0070.0538.56
5.0.20.0030.0278.56
5.0.10.0000.0308.56
5.0.00.0000.0438.56
4.4.90.0070.0178.56
4.4.80.0070.0178.56
4.4.70.0100.0238.56
4.4.60.0070.0208.56
4.4.50.0000.0238.56
4.4.40.0070.0438.56
4.4.30.0030.0208.56
4.4.20.0070.0208.56
4.4.10.0070.0278.56
4.4.00.0000.0378.56
4.3.110.0100.0138.56
4.3.100.0100.0208.56
4.3.90.0030.0238.56
4.3.80.0070.0308.56
4.3.70.0000.0238.56
4.3.60.0000.0238.56
4.3.50.0000.0278.56
4.3.40.0070.0378.56
4.3.30.0000.0308.56
4.3.20.0000.0238.56
4.3.10.0030.0208.56
4.3.00.0030.01313.23

preferences:
170.58 ms | 1386 KiB | 7 Q