3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sed(string $re, string $sub): string { if (mb_strlen($re, "8bit") < 4 || $re[0] !== "s") throw new Error("Your syntax is invalid, go drown yourself"); [1 => $re, 2 => $rep, 3 => $mod] = preg_split("|(\\\\{2})*\K{$re[1]}|", $re); $re = str_replace('@', '\@', $re); return preg_replace("@$re@$mod", $rep, $sub); } echo sed('s/Cat/Fox\\/i', 'Cat makes dog play guitar.'), PHP_EOL;

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.70.0170.00318.68
8.3.60.0100.00716.63
8.3.50.0080.01117.48
8.3.40.0090.00618.89
8.3.30.0130.00318.84
8.3.20.0040.01120.07
8.3.10.0000.00823.70
8.3.00.0080.00023.48
8.2.190.0040.01116.63
8.2.180.0130.00318.66
8.2.170.0070.01522.96
8.2.160.0170.00020.33
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00226.35
8.2.110.0060.00322.37
8.2.100.0060.00618.09
8.2.90.0080.00019.13
8.2.80.0040.00418.03
8.2.70.0030.00517.88
8.2.60.0000.00818.22
8.2.50.0000.00918.28
8.2.40.0000.00820.63
8.2.30.0000.00719.21
8.2.20.0040.00419.88
8.2.10.0020.00518.03
8.2.00.0040.00418.02
8.1.280.0120.00325.92
8.1.270.0050.00323.83
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00323.84
8.1.230.0040.00717.83
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0060.00317.48
8.1.190.0080.00017.51
8.1.180.0000.00918.10
8.1.170.0040.00418.65
8.1.160.0040.00418.91
8.1.150.0050.00218.95
8.1.140.0040.00419.61
8.1.130.0040.00717.70
8.1.120.0040.00417.55
8.1.110.0040.00417.59
8.1.100.0030.00517.54
8.1.90.0000.00817.49
8.1.80.0000.00717.51
8.1.70.0000.00717.53
8.1.60.0040.00417.73
8.1.50.0040.00417.73
8.1.40.0060.00317.70
8.1.30.0060.00317.80
8.1.20.0000.00817.85
8.1.10.0030.00517.78
8.1.00.0000.00717.64
8.0.300.0040.00418.77
8.0.290.0060.00317.00
8.0.280.0030.00318.48
8.0.270.0070.00017.36
8.0.260.0000.00717.03
8.0.250.0070.00017.16
8.0.240.0000.00817.14
8.0.230.0050.00317.16
8.0.220.0070.00017.07
8.0.210.0050.00317.01
8.0.200.0080.00017.13
8.0.190.0040.00417.19
8.0.180.0000.00817.04
8.0.170.0000.00717.03
8.0.160.0000.00916.99
8.0.150.0000.00817.09
8.0.140.0040.00417.03
8.0.130.0030.00313.49
8.0.120.0030.00616.92
8.0.110.0040.00416.96
8.0.100.0080.00017.04
8.0.90.0040.00416.90
8.0.80.0120.00617.09
8.0.70.0040.00417.04
8.0.60.0000.00717.13
8.0.50.0040.00417.13
8.0.30.0090.00717.14
8.0.20.0130.00917.40
8.0.10.0070.00017.07
8.0.00.0120.00616.99
7.4.330.0020.00216.79
7.4.320.0000.00716.61
7.4.300.0000.00616.70
7.4.290.0050.00316.64
7.4.280.0040.00416.70
7.4.270.0020.00516.70
7.4.260.0000.00716.70
7.4.250.0070.00016.79
7.4.240.0000.00816.74
7.4.230.0030.00316.59
7.4.220.0140.00716.88
7.4.210.0070.00816.80
7.4.200.0030.00316.92
7.4.160.0080.00916.54
7.4.150.0090.00917.40
7.4.140.0100.00917.86
7.4.130.0140.00416.68
7.4.120.0100.00916.72
7.4.110.0130.00316.55
7.4.100.0040.01316.56
7.4.90.0120.00616.76
7.4.80.0110.00719.39
7.4.70.0070.01116.71
7.4.60.0060.01016.76
7.4.50.0030.01316.70
7.4.40.0030.01316.83
7.4.30.0090.00616.83
7.4.10.0040.01414.85
7.4.00.0080.00615.14
7.3.330.0000.00613.45
7.3.320.0030.00313.44
7.3.310.0030.00316.55
7.3.300.0070.00016.46
7.3.290.0030.00316.39
7.3.280.0080.00916.51
7.3.270.0130.00517.40
7.3.260.0090.00916.64
7.3.250.0090.00916.73
7.3.240.0130.00516.70
7.3.230.0140.00416.55
7.3.210.0120.00616.88
7.3.200.0120.00316.56
7.3.190.0090.00816.78
7.3.180.0030.01316.61
7.3.170.0130.00316.55
7.3.160.0030.01316.81
7.3.130.0070.01315.26
7.3.120.0050.01015.01
7.3.110.0060.00915.13
7.3.100.0060.00914.97
7.3.90.0050.01214.98
7.3.80.0040.00915.23
7.3.70.0070.00414.95
7.3.60.0070.00714.83
7.3.50.0040.00914.98
7.3.40.0070.00514.97
7.3.30.0080.00615.04
7.3.20.0060.00816.87
7.3.10.0050.00916.83
7.3.00.0070.00716.80
7.2.330.0140.00416.84
7.2.320.0000.01716.95
7.2.310.0140.01116.87
7.2.300.0120.00916.80
7.2.290.0070.01316.65
7.2.260.0110.00715.14
7.2.250.0130.00715.26
7.2.240.0030.01415.04
7.2.230.0100.00615.14
7.2.220.0020.01415.08
7.2.210.0050.00715.26
7.2.200.0140.00315.20
7.2.190.0090.00615.14
7.2.180.0070.00715.19
7.2.170.0070.00415.31
7.2.160.0020.01215.18
7.2.150.0050.00916.94
7.2.140.0090.00817.06
7.2.130.0060.00717.11
7.2.120.0060.00916.87
7.2.110.0060.00617.04
7.2.100.0090.00316.84
7.2.90.0100.00717.05
7.2.80.0060.00817.04
7.2.70.0050.01017.03
7.2.60.0070.00817.10
7.2.50.0000.01117.14
7.2.40.0020.00916.86
7.2.30.0050.01217.15
7.2.20.0020.01017.21
7.2.10.0050.01117.10
7.2.00.0030.00717.24
7.1.330.0060.01016.00
7.1.320.0030.01016.02
7.1.310.0060.00815.89
7.1.300.0060.00415.99
7.1.290.0100.00416.03
7.1.280.0100.00516.03
7.1.270.0070.00715.98
7.1.260.0050.00615.88
7.1.250.0030.01015.91
7.1.240.0100.00315.90
7.1.230.0040.00415.92
7.1.220.0060.00615.71
7.1.210.0040.00715.68
7.1.200.0020.01115.96
7.1.190.0030.00915.72
7.1.180.0000.01015.67
7.1.170.0040.01116.15
7.1.160.0030.00915.90
7.1.150.0040.00416.00
7.1.140.0000.01316.12
7.1.130.0030.01016.00
7.1.120.0050.00316.18
7.1.110.0130.00716.40
7.1.100.0070.01016.38
7.1.90.0070.01216.27
7.1.80.0080.00817.17
7.1.70.0080.00916.60
7.1.60.0060.01625.67
7.1.50.0190.00625.51
7.1.40.0160.00924.49
7.1.30.0200.00325.31
7.1.20.0090.00925.54
7.1.10.0050.01115.48
7.1.00.0130.00515.60
7.0.330.0060.00315.29
7.0.320.0040.00715.16
7.0.310.0070.00715.45
7.0.300.0000.01415.25
7.0.290.0070.00715.23
7.0.280.0110.00415.05
7.0.270.0030.01015.27
7.0.260.0000.01415.32
7.0.250.0100.00716.54
7.0.240.0100.00515.45
7.0.230.0110.00615.39
7.0.220.0090.00515.61
7.0.210.0090.00515.88
7.0.200.0090.00415.86
7.0.190.0090.00715.04
7.0.180.0060.00714.80
7.0.170.0040.01115.58
7.0.160.0070.00914.64
7.0.150.0050.01114.67
7.0.140.0030.01115.77
7.0.130.0260.00714.90
7.0.120.0090.00715.02
7.0.110.0100.00614.88
7.0.100.0020.01314.84
7.0.90.0150.00915.82
7.0.80.0050.00815.67
7.0.70.0060.00615.55
7.0.60.0060.00415.51
7.0.50.0060.00615.74
7.0.40.0060.00514.70
7.0.30.0070.00414.81
7.0.20.0020.01114.68
7.0.10.0060.00714.83
7.0.00.0070.00314.61
5.6.400.0140.00014.16
5.6.390.0060.00614.42
5.6.380.0060.00614.26
5.6.370.0060.00314.07
5.6.360.0070.01014.34
5.6.350.0040.01114.41
5.6.340.0050.00514.30
5.6.330.0100.00614.01
5.6.320.0070.01114.10
5.6.310.0130.00313.96
5.6.300.0150.00314.35
5.6.290.0030.01014.18
5.6.280.0080.00414.15
5.6.270.0090.00614.02
5.6.260.0070.00414.11
5.6.250.0070.01014.07
5.6.240.0070.00714.20
5.6.230.0000.00914.09
5.6.220.0070.00714.10
5.6.210.0000.01314.18
5.6.200.0040.00414.16
5.6.190.0030.00914.30
5.6.180.0070.00713.98
5.6.170.0080.00414.04
5.6.160.0000.01614.08
5.6.150.0070.00713.97
5.6.140.0030.01214.05
5.6.130.0090.00314.09
5.6.120.0000.00814.25
5.6.110.0030.00714.02
5.6.100.0060.00614.16
5.6.90.0130.00014.08
5.6.80.0070.00713.79
5.6.70.0030.00513.91
5.6.60.0030.01413.95
5.6.50.0060.00614.27
5.6.40.0100.00314.22
5.6.30.0100.00313.95
5.6.20.0130.00314.02
5.6.10.0130.00313.95
5.6.00.0060.00614.12

preferences:
66.68 ms | 401 KiB | 5 Q