3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["{A}", "{B}", "{C}", "{A}"]; $start = '<span class="c">'; $end = '</span>'; $string = "{A}{B}{C}{A}"; foreach (array_unique($arr) as $item) { $string = str_replace($item, $start . $item . $end, $string); } echo $string;

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.0070.01418.43
8.3.50.0060.01321.15
8.3.40.0060.00918.76
8.3.30.0080.00618.68
8.3.20.0070.00021.73
8.3.10.0080.00020.15
8.3.00.0030.00623.45
8.2.180.0040.01425.92
8.2.170.0040.01219.09
8.2.160.0130.00022.96
8.2.150.0060.00325.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00326.16
8.2.110.0040.00420.38
8.2.100.0110.00017.91
8.2.90.0000.00720.42
8.2.80.0040.00417.97
8.2.70.0000.00817.92
8.2.60.0080.00018.09
8.2.50.0000.00818.10
8.2.40.0040.00419.29
8.2.30.0040.00419.25
8.2.20.0050.00317.98
8.2.10.0000.00719.31
8.2.00.0030.00620.61
8.1.280.0160.00325.92
8.1.270.0000.00723.83
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0090.00023.73
8.1.230.0040.00720.95
8.1.220.0050.00317.74
8.1.210.0090.00018.99
8.1.200.0040.00417.35
8.1.190.0000.00817.25
8.1.180.0040.00418.10
8.1.170.0040.00418.48
8.1.160.0000.00718.88
8.1.150.0000.00718.76
8.1.140.0000.00722.13
8.1.130.0070.00020.10
8.1.120.0030.00517.35
8.1.110.0040.00417.33
8.1.100.0080.00317.35
8.1.90.0060.00317.50
8.1.80.0040.00417.49
8.1.70.0030.00317.46
8.1.60.0040.00417.50
8.1.50.0030.00517.41
8.1.40.0050.00317.54
8.1.30.0080.00017.62
8.1.20.0030.00617.60
8.1.10.0000.00817.47
8.1.00.0040.00417.29
8.0.300.0040.00419.94
8.0.290.0030.00916.58
8.0.280.0000.00718.36
8.0.270.0030.00317.18
8.0.260.0000.00620.07
8.0.250.0000.00716.89
8.0.240.0070.00016.97
8.0.230.0000.00716.89
8.0.220.0000.00716.75
8.0.210.0030.00316.87
8.0.200.0040.00416.84
8.0.190.0060.00316.91
8.0.180.0070.00016.84
8.0.170.0040.00416.88
8.0.160.0000.00716.79
8.0.150.0040.00416.86
8.0.140.0030.00316.83
8.0.130.0030.00313.31
8.0.120.0070.00016.88
8.0.110.0040.00416.79
8.0.100.0040.00416.87
8.0.90.0040.00416.76
8.0.80.0160.00616.88
8.0.70.0000.00716.76
8.0.60.0030.00516.77
8.0.50.0040.00416.91
8.0.30.0130.00816.86
8.0.20.0120.00917.04
8.0.10.0040.00416.86
8.0.00.0110.00816.70
7.4.330.0030.00315.55
7.4.320.0000.00616.40
7.4.300.0060.00016.51
7.4.290.0030.00516.50
7.4.280.0030.00616.51
7.4.270.0000.00616.60
7.4.260.0000.00716.44
7.4.250.0030.00316.61
7.4.240.0010.00616.51
7.4.230.0030.00716.44
7.4.220.0030.00516.49
7.4.210.0100.00416.62
7.4.200.0050.00216.66
7.4.140.0060.01217.86
7.4.130.0060.01216.36
7.4.120.0150.00416.41
7.4.110.0060.01216.47
7.4.100.0060.01616.53
7.4.90.0090.00916.48
7.4.80.0040.01419.39
7.4.70.0120.00416.52
7.4.60.0160.00016.36
7.4.50.0060.01216.52
7.4.40.0090.00916.47
7.4.00.0070.01014.89
7.3.330.0000.00613.14
7.3.320.0000.00513.06
7.3.310.0060.00016.30
7.3.300.0050.00216.29
7.3.290.0000.00716.23
7.3.280.0060.00916.25
7.3.260.0100.00816.44
7.3.240.0100.00916.57
7.3.230.0080.00916.53
7.3.210.0110.00516.23
7.3.200.0030.01416.60
7.3.190.0060.01216.48
7.3.180.0100.00716.36
7.3.170.0100.00716.19
7.3.160.0120.00316.53
7.3.120.0040.01115.01
7.3.110.0070.01014.59
7.3.100.0060.00615.14
7.3.90.0100.00714.80
7.3.80.0030.01214.68
7.3.70.0110.00614.83
7.3.60.0120.01014.78
7.3.50.0060.00814.79
7.3.40.0060.00914.58
7.3.30.0070.00914.71
7.3.20.0170.00315.50
7.3.10.0510.01015.62
7.3.00.0090.00915.43
7.2.330.0110.00616.70
7.2.320.0060.01016.79
7.2.310.0130.00316.68
7.2.300.0160.00016.49
7.2.290.0090.00616.62
7.2.250.0090.01214.74
7.2.240.0030.01615.11
7.2.230.0030.01014.99
7.2.220.0100.00614.96
7.2.210.0070.00714.96
7.2.200.0110.00514.99
7.2.190.0100.00715.12
7.2.180.0060.00814.99
7.2.170.0080.01114.98
7.2.160.0030.01015.13
7.2.150.0140.01015.08
7.2.140.0200.00615.20
7.2.130.0270.00315.19
7.2.120.0160.00814.90
7.2.110.0210.00915.16
7.2.100.0150.01115.21
7.2.90.0230.00015.14
7.2.80.0150.00815.15
7.2.70.0180.00815.23
7.2.60.0300.00315.01
7.2.50.0160.01015.09
7.2.40.0130.00615.21
7.2.30.0180.00914.82
7.2.20.0180.00714.91
7.2.10.0110.00615.19
7.2.00.0710.01315.12
7.1.330.0070.00715.94
7.1.320.0040.01216.07
7.1.310.0090.00615.66
7.1.300.0110.00814.88
7.1.290.0100.00814.84
7.1.280.0110.01014.87
7.1.270.0110.00814.71
7.1.260.0080.01014.89
7.1.250.0180.00413.75

preferences:
58.92 ms | 401 KiB | 5 Q