3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a="a / b"; $a=preg_replace('/\//','\\',$a); echo "First version: {$a}\n"; $a=preg_replace('/\//','\\\\',$a); echo "Second version: {$a}\n"; ?>

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.0.30.0080.01117.17
8.0.20.0120.00817.40
8.0.00.0090.01416.95
7.4.150.0120.00917.40
7.4.140.0140.00517.86
7.4.130.0110.00716.85
7.4.120.0080.00916.77
7.4.110.0110.00716.68
7.4.100.0130.00916.69
7.4.90.0200.00316.68
7.4.80.0150.00619.39
7.4.70.0110.00516.48
7.4.60.0100.00616.64
7.4.50.0030.01416.61
7.4.40.0100.00616.60
7.4.30.0030.01316.67
7.4.00.0100.00815.02
7.3.270.0100.01317.40
7.3.260.0080.01016.54
7.3.250.0130.00816.51
7.3.240.0100.00816.57
7.3.230.0030.01316.42
7.3.210.0130.00316.40
7.3.200.0060.00916.32
7.3.190.0130.00616.73
7.3.180.0140.00716.66
7.3.170.0090.00916.70
7.3.160.0130.00416.45
7.3.120.0090.00714.68
7.3.110.0120.00715.11
7.3.100.0040.01114.81
7.3.90.0000.01514.93
7.3.80.0030.00814.86
7.3.70.0030.01114.80
7.3.60.0090.00614.65
7.3.50.0050.00814.78
7.3.40.0040.01014.78
7.3.30.0080.00614.82
7.3.20.0070.00616.67
7.3.10.0050.00816.77
7.3.00.0080.00616.85
7.2.330.0070.01016.54
7.2.320.0030.01816.84
7.2.310.0050.01116.87
7.2.300.0060.01416.71
7.2.290.0060.01116.79
7.2.250.0120.00615.11
7.2.240.0050.01015.12
7.2.230.0090.00414.97
7.2.220.0050.00815.12
7.2.210.0020.01115.11
7.2.200.0040.00714.92
7.2.190.0060.01015.10
7.2.180.0050.01214.97
7.2.170.0060.00915.05
7.2.160.0130.00014.99
7.2.150.0040.00916.89
7.2.140.0110.00616.85
7.2.130.0070.00717.06
7.2.120.0140.00316.73
7.2.110.0070.01417.04
7.2.100.0070.01016.64
7.2.90.0070.00717.07
7.2.80.0070.00717.06
7.2.70.0120.00617.04
7.2.60.0050.01017.01
7.2.50.0100.01017.01
7.2.40.0090.00616.94
7.2.30.0130.00316.81
7.2.20.0110.00617.04
7.2.10.0030.00716.97
7.2.00.0110.00617.00
7.1.330.0040.01315.88
7.1.320.0070.00715.90
7.1.310.0050.00715.89
7.1.300.0070.00916.03
7.1.290.0060.00615.73
7.1.280.0070.00715.93
7.1.270.0060.00415.66
7.1.260.0090.00715.81
7.1.250.0100.00715.92
7.1.200.0090.00315.99
7.1.70.0100.00617.46
7.1.60.0100.00717.37
7.1.00.0000.08022.41
7.0.200.0080.00415.18
7.0.100.0970.06019.95
7.0.90.1100.05020.00
7.0.80.0970.05719.91
7.0.70.0200.05019.95
7.0.60.0030.06719.94
7.0.50.0170.05020.35
7.0.40.0300.05720.39
7.0.30.1100.06320.39
7.0.20.0930.05020.27
7.0.10.0970.05020.32
7.0.00.1100.07720.38
5.6.250.0070.06320.52
5.6.240.0130.05720.60
5.6.230.0130.05720.73
5.6.220.0130.05720.67
5.6.210.0170.06020.66
5.6.200.0030.06321.04
5.6.190.0130.06321.07
5.6.180.0230.04721.17
5.6.170.0130.05321.05
5.6.160.0130.05321.11
5.6.150.0130.06021.01
5.6.140.0100.06021.11
5.6.130.0170.05321.16
5.6.120.0100.06021.06
5.6.110.0070.06021.16
5.6.100.0170.05021.15
5.6.90.0170.05321.15
5.6.80.0100.05720.41
5.6.70.0130.05320.43
5.6.60.0100.05320.44
5.6.50.0100.05320.45
5.6.40.0030.06020.43
5.6.30.0200.04020.46
5.6.20.0070.05320.52
5.6.10.0100.05320.42
5.6.00.0170.04320.43