3v4l.org

run code in 500+ PHP versions simultaneously
<?php function my_replace(string $fullText, string $searchText){ $searches = explode(' ',$searchText); $replace = array(); foreach ($searches as $i => $search){ $position = strlen($search)+stripos($fullText, $search); $fullText = substr_replace($fullText, '<- ', $position, 0); } return $fullText; } echo my_replace('A week ago, Elvis left the Building', 'elvis left bonk');

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.5.30.0090.00819.53
8.5.20.0100.00919.41
8.5.10.0080.01116.82
8.5.00.0120.01019.82
8.4.180.0130.00919.43
8.4.170.0140.00823.86
8.4.160.0130.00922.74
8.4.150.0070.00516.76
8.4.140.0140.00617.56
8.4.130.0110.01017.55
8.4.120.0110.00820.80
8.4.110.0060.00322.48
8.4.100.0120.00917.73
8.4.90.0100.01018.56
8.4.80.0120.00817.57
8.4.70.0080.00417.68
8.4.60.0140.00518.38
8.4.50.0080.00618.91
8.4.40.0090.00917.43
8.4.30.0130.00619.39
8.4.20.0160.00620.10
8.4.10.0130.00717.53
8.3.300.0130.00720.69
8.3.290.0130.00620.72
8.3.280.0140.00618.20
8.3.270.0100.00916.68
8.3.260.0130.00716.47
8.3.250.0050.00319.16
8.3.240.0140.00617.17
8.3.230.0120.00816.64
8.3.220.0090.00817.12
8.3.210.0100.00516.55
8.3.200.0060.00316.47
8.3.190.0130.00516.84
8.3.180.0150.00316.43
8.3.170.0120.00416.59
8.3.160.0090.00616.62
8.3.150.0120.00617.21
8.3.140.0150.00320.68
8.3.130.0050.00318.43
8.3.120.0060.00320.85
8.3.110.0050.00320.94
8.3.100.0000.00724.06
8.3.90.0040.00426.77
8.3.80.0130.00017.97
8.3.70.0110.00416.64
8.3.60.0040.01518.31
8.3.50.0080.00518.11
8.3.40.0160.00018.59
8.3.30.0120.00318.47
8.3.20.0080.00018.48
8.3.10.0000.00818.81
8.3.00.0050.00323.64
8.2.300.0100.01020.42
8.2.290.0110.00920.35
8.2.280.0040.00418.18
8.2.270.0060.01016.67
8.2.260.0140.00419.12
8.2.250.0030.00618.17
8.2.240.0040.01116.88
8.2.230.0090.00322.58
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0100.00016.75
8.2.190.0110.00418.37
8.2.180.0110.00416.38
8.2.170.0100.00722.96
8.2.160.0070.00722.12
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00821.07
8.2.120.0000.00826.35
8.2.110.0070.00320.96
8.2.100.0060.00617.97
8.2.90.0060.00317.88
8.2.80.0030.00617.97
8.2.70.0040.00417.79
8.2.60.0040.00418.03
8.2.50.0080.00018.10
8.2.40.0040.00421.02
8.2.30.0040.00420.50
8.2.20.0000.00717.96
8.2.10.0070.00018.05
8.2.00.0080.00018.24
8.1.340.0110.01017.73
8.1.330.0120.00721.90
8.1.320.0120.00715.89
8.1.310.0040.01118.55
8.1.300.0030.00618.10
8.1.290.0030.00630.84
8.1.280.0150.00025.92
8.1.270.0040.00420.38
8.1.260.0040.00426.35
8.1.250.0030.00728.09
8.1.240.0060.00322.14
8.1.230.0080.00317.70
8.1.220.0000.00817.78
8.1.210.0050.00318.77
8.1.200.0000.00817.22
8.1.190.0000.00817.36
8.1.180.0000.00818.10
8.1.170.0000.00818.71
8.1.160.0040.00418.88
8.1.150.0000.00718.88
8.1.140.0040.00418.88
8.1.130.0070.00019.23
8.1.120.0050.00217.46
8.1.110.0000.00717.34
8.1.100.0030.00617.36
8.1.90.0040.00417.39
8.1.80.0040.00417.36
8.1.70.0080.00017.51
8.1.60.0000.00817.63
8.1.50.0040.00417.50
8.1.40.0040.00417.44
8.1.30.0000.00917.68
8.1.20.0040.00417.69
8.1.10.0050.00217.40
8.1.00.0090.00017.40
8.0.300.0000.00918.77
8.0.290.0040.00416.75
8.0.280.0030.00318.36
8.0.270.0070.00017.29
8.0.260.0000.00716.88
8.0.250.0030.00317.05
8.0.240.0030.00316.91
8.0.230.0000.00717.07
8.0.220.0040.00316.96
8.0.210.0070.00016.86
8.0.200.0040.00417.03
8.0.190.0030.00516.96
8.0.180.0040.00416.97
8.0.170.0080.00016.96
8.0.160.0030.00516.92
8.0.150.0000.00716.87
8.0.140.0050.00316.91
8.0.130.0060.00013.33
8.0.120.0030.00516.84
8.0.110.0040.00416.83
8.0.100.0000.00716.73
8.0.90.0000.00816.83
8.0.80.0060.01016.94
8.0.70.0040.00416.81
8.0.60.0040.00416.89
8.0.50.0000.00716.80
8.0.30.0080.00917.02
8.0.20.0040.01517.40
8.0.10.0000.00716.95
8.0.00.0130.00616.76
7.4.330.0000.00515.55
7.4.320.0030.00316.60
7.4.300.0000.00616.41
7.4.290.0070.00016.61
7.4.280.0000.00716.48
7.4.270.0050.00316.59
7.4.260.0030.00616.50
7.4.250.0000.00716.47
7.4.240.0030.00516.45
7.4.230.0070.00016.40
7.4.220.0050.00316.70
7.4.210.0080.00616.46
7.4.200.0070.00016.57
7.4.160.0110.00516.43
7.4.140.0080.01017.86
7.4.130.0070.01016.29
7.4.120.0090.00916.54
7.4.110.0130.00316.44
7.4.100.0070.01016.59
7.4.90.0060.01216.63
7.4.80.0090.00919.39
7.4.70.0100.00616.68
7.4.60.0070.01316.58
7.4.50.0060.00916.66
7.4.40.0140.00416.52
7.4.00.0040.01414.77
7.3.330.0000.00513.21
7.3.320.0000.00513.17
7.3.310.0070.00016.30
7.3.300.0030.00316.21
7.3.290.0070.00016.21
7.3.280.0080.01116.36
7.3.260.0150.00716.38
7.3.240.0080.00916.45
7.3.230.0060.00916.45
7.3.210.0000.01816.34
7.3.200.0100.00716.37
7.3.190.0090.01016.52
7.3.180.0070.01416.39
7.3.170.0030.01316.43
7.3.160.0090.01216.44
7.3.120.0030.01214.88
7.3.110.0060.01014.80
7.3.100.0060.00914.68
7.3.90.0080.00814.82
7.3.80.0060.00914.83
7.3.70.0090.00314.83
7.3.60.0000.01314.81
7.3.50.0060.00614.67
7.3.40.0030.01314.60
7.3.30.0070.00714.91
7.3.20.0040.01116.70
7.3.10.0070.00516.69
7.3.00.0030.00616.79
7.2.330.0090.00916.50
7.2.320.0100.01416.75
7.2.310.0080.00816.75
7.2.300.0100.01016.73
7.2.290.0140.00316.75
7.2.240.0000.01514.84
7.2.230.0030.01014.87
7.2.220.0100.00614.80
7.2.210.0060.00914.90
7.2.200.0030.00914.84
7.2.190.0110.00015.13
7.2.180.0000.00914.72
7.2.170.0060.00615.07
7.2.160.0080.00815.13
7.2.150.0060.00616.89
7.2.140.0070.00716.99
7.2.130.0050.00516.84
7.2.120.0070.00416.96
7.2.110.0080.00716.93
7.2.100.0770.00816.22
7.2.90.0690.00816.31
7.2.80.0870.00816.13
7.2.70.0790.01016.38
7.2.60.0910.01316.20
7.2.50.0800.00716.44
7.2.40.0770.01116.42
7.2.30.0910.00816.28
7.2.20.0800.01116.40
7.2.10.1110.00916.33
7.2.00.1040.00716.19
7.1.330.0060.00815.60
7.1.320.0120.00315.80
7.1.310.0030.00915.68
7.1.300.0030.00515.79
7.1.290.0030.00615.79
7.1.280.0000.01015.73
7.1.270.0040.01115.66
7.1.260.0040.01115.47
7.1.250.0050.01016.02
7.1.220.2170.01313.98
7.1.210.1760.01013.93
7.1.200.2290.00613.82
7.1.190.2310.00713.96
7.1.180.2420.01013.98
7.1.170.2440.01013.79
7.1.160.2600.01013.89
7.1.150.2530.00313.66
7.1.140.3260.00613.76
7.1.130.3140.00713.90
7.1.120.3140.00713.59
7.1.110.2980.01014.00
7.1.100.2370.01013.76
7.1.90.2760.01013.50
7.1.80.2400.01013.65
7.1.70.3520.00313.43
7.1.60.2390.00731.70
7.1.50.3020.01631.94
7.1.40.3370.00631.88
7.1.30.3650.00731.79
7.1.20.3070.01031.72
7.1.10.3220.00713.50
7.1.00.3090.01313.62
5.6.380.0040.01214.07

preferences:
143.61 ms | 1597 KiB | 5 Q