3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = "we went to see a ewe"; var_dump(str_replace(['e', 'w'], ['w', 'e'], $subject)); var_dump(str_replace([0 => 'e', 1 => 'w'], [0 => 'w', 1 => 'e'], $subject)); var_dump(preg_replace(['/e/', '/w/'], ['w', 'e'], $subject)); var_dump(preg_replace([0 => '/e/', 1 => '/w/'], [0 => 'w', 1 => 'e'], $subject));

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.3.60.0060.00918.31
8.3.50.0040.01119.86
8.3.40.0090.00618.79
8.3.30.0040.01218.67
8.3.20.0040.00420.21
8.3.10.0020.00521.76
8.3.00.0040.00419.25
8.2.180.0150.00316.50
8.2.170.0090.00622.96
8.2.160.0040.01119.36
8.2.150.0070.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00421.00
8.2.120.0070.00026.35
8.2.110.0040.00822.10
8.2.100.0060.00617.80
8.2.90.0050.00319.03
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0040.00417.93
8.2.50.0000.00818.10
8.2.40.0000.00820.63
8.2.30.0040.00421.04
8.2.20.0070.00017.84
8.2.10.0000.00817.91
8.2.00.0000.00818.01
8.1.280.0140.00325.92
8.1.270.0140.00024.02
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0090.00022.54
8.1.230.0070.00417.55
8.1.220.0030.00517.74
8.1.210.0030.00518.77
8.1.200.0060.00317.38
8.1.190.0080.00017.23
8.1.180.0080.00018.10
8.1.170.0000.00918.64
8.1.160.0030.00322.22
8.1.150.0040.00418.84
8.1.140.0000.00819.50
8.1.130.0030.00317.60
8.1.120.0070.00017.52
8.1.110.0080.00017.58
8.1.100.0030.00517.60
8.1.90.0040.00417.57
8.1.80.0040.00417.54
8.1.70.0030.00717.57
8.1.60.0080.00017.58
8.1.50.0080.00017.64
8.1.40.0000.00817.55
8.1.30.0090.00017.65
8.1.20.0000.00717.74
8.1.10.0040.00417.63
8.1.00.0060.00617.43
8.0.300.0000.00818.77
8.0.290.0000.00816.63
8.0.280.0030.00318.40
8.0.270.0030.00317.13
8.0.260.0030.00617.10
8.0.250.0000.00817.09
8.0.240.0000.00716.99
8.0.230.0050.00216.93
8.0.220.0030.00316.89
8.0.210.0070.00016.86
8.0.200.0030.00316.93
8.0.190.0000.00917.04
8.0.180.0030.00517.00
8.0.170.0040.00717.05
8.0.160.0000.00716.98
8.0.150.0040.00416.80
8.0.140.0030.00616.96
8.0.130.0050.00313.42
8.0.120.0000.00816.84
8.0.110.0060.00317.02
8.0.100.0040.00416.94
8.0.90.0040.00417.03
8.0.80.0030.01716.96
8.0.70.0050.00216.87
8.0.60.0000.00716.86
8.0.50.0030.00516.87
8.0.30.0110.00916.95
8.0.20.0080.01117.43
8.0.10.0040.00417.22
8.0.00.0150.00316.65
7.4.330.0000.00515.08
7.4.320.0000.00616.76
7.4.300.0070.00016.77
7.4.290.0000.00716.61
7.4.280.0030.00616.77
7.4.270.0040.00416.59
7.4.260.0030.00316.75
7.4.250.0080.00016.77
7.4.240.0040.00416.71
7.4.230.0040.00316.55
7.4.220.0120.01516.61
7.4.210.0140.00016.71
7.4.200.0000.00716.75
7.4.160.0130.00616.74
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0110.00816.75
7.4.120.0050.01316.76
7.4.110.0060.01216.60
7.4.100.0100.00916.57
7.4.90.0180.00716.70
7.4.80.0070.01019.39
7.4.70.0060.01116.70
7.4.60.0090.01416.73
7.4.50.0060.01116.58
7.4.40.0040.01216.66
7.4.30.0060.01216.69
7.4.00.0100.00814.98
7.3.330.0000.00613.21
7.3.320.0000.00613.18
7.3.310.0000.00716.12
7.3.300.0000.00716.16
7.3.290.0090.00916.31
7.3.280.0070.00916.26
7.3.270.0120.00617.40
7.3.260.0110.00816.42
7.3.250.0100.01016.31
7.3.240.0080.01216.46
7.3.230.0100.00716.67
7.3.210.0070.01016.52
7.3.200.0110.00616.26
7.3.190.0060.00916.23
7.3.180.0080.00816.36
7.3.170.0080.00816.45
7.3.160.0000.01716.48
7.3.120.0150.00614.91
7.3.110.0100.00715.10
7.3.100.0030.00714.81
7.3.90.0130.00615.04
7.3.80.0000.01514.66
7.3.70.0030.01015.03
7.3.60.0000.01314.75
7.3.50.0060.00614.96
7.3.40.0070.00714.79
7.3.30.0100.00314.96
7.3.20.0000.01016.75
7.3.10.0110.00516.65
7.3.00.0140.00516.81
7.2.330.0110.00716.61
7.2.320.0070.01016.67
7.2.310.0070.01016.61
7.2.300.0120.01516.78
7.2.290.0030.01316.55
7.2.250.0040.01515.06
7.2.240.0000.02114.94
7.2.230.0100.00715.25
7.2.220.0000.01114.96
7.2.210.0040.01115.08
7.2.200.0030.01014.89
7.2.190.0100.00014.96
7.2.180.0040.00815.06
7.2.170.0040.00815.05
7.2.130.0130.00616.94
7.2.120.0080.01216.88
7.2.110.0110.00416.77
7.2.100.0110.00616.94
7.2.90.0030.00916.78
7.2.80.0150.00616.62
7.2.70.0080.00817.06
7.2.60.0110.00316.87
7.2.50.0070.00716.88
7.2.40.0130.00416.96
7.2.30.0150.00716.79
7.2.20.0110.00716.66
7.2.10.0070.00716.88
7.2.00.0040.01017.95
7.1.330.0030.01315.68
7.1.320.0070.00716.04
7.1.310.0000.01415.63
7.1.300.0090.00616.03
7.1.290.0030.01015.69
7.1.280.0080.00815.84
7.1.270.0030.01015.90
7.1.260.0090.00016.04
7.1.250.0070.00315.92
7.1.200.0070.00716.05
7.1.100.0030.00718.42
7.1.70.0040.00716.97
7.1.60.0030.00919.45
7.1.00.0100.06722.35
7.0.200.0280.00416.86
7.0.80.0870.07020.04
7.0.70.0170.06019.94
7.0.60.0100.06720.00
7.0.50.0200.05720.36
7.0.40.0100.07020.45
7.0.30.0200.07320.30
7.0.20.0300.04720.29
7.0.10.0000.07320.32
7.0.00.0230.07020.34
5.6.230.0170.05720.49
5.6.220.0170.06320.55
5.6.210.0100.06020.56
5.6.200.0170.06721.05
5.6.190.0230.06721.13
5.6.180.0130.06021.11
5.6.170.0070.07321.08
5.6.160.0100.06321.08
5.6.150.0070.06721.12
5.6.140.0130.06021.06
5.6.130.0300.04321.06
5.6.120.0200.05721.20
5.6.110.0130.06321.10
5.6.100.0100.07321.06
5.6.90.0130.07721.00
5.6.80.0130.06020.41
5.6.70.0100.06020.51
5.6.60.0100.05320.39
5.6.50.0100.07020.46
5.6.40.0070.06020.37
5.6.30.0130.05320.46
5.6.20.0130.05320.49
5.6.10.0170.05020.48
5.6.00.0270.04020.42

preferences:
63.79 ms | 401 KiB | 5 Q