3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<EOD http://localhost:8000/search/fa?q=sth http://localhost:8000/search?q=sth http://localhost:8000/search http://localhost:8000/search/fa EOD; preg_match_all('/^(.*?)\/(\w{2,})(?:\?(.*?)|)$/mis',$str,$p); echo '<pre/>'; $final_array = array(); $i = 0; foreach($p[1] as $myP){ if( $p[2][$i] == 'fa'){ $p[2][$i] = 'en'; } else if($p[2][$i] != 'en') { $p[2][$i] = $p[2][$i].'/'.'en'; } $final_array[$i] = $myP.'/'.$p[2][$i]; $i++; } var_dump($final_array);

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.01516.88
8.3.50.0110.00318.54
8.3.40.0090.00618.87
8.3.30.0140.00018.95
8.3.20.0030.00619.16
8.3.10.0020.00521.89
8.3.00.0040.00423.74
8.2.180.0150.00016.63
8.2.170.0040.01122.96
8.2.160.0090.00922.20
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00019.36
8.2.110.0050.00521.06
8.2.100.0080.00318.03
8.2.90.0000.00820.35
8.2.80.0040.00420.52
8.2.70.0000.00817.80
8.2.60.0070.00318.22
8.2.50.0000.00919.33
8.2.40.0060.00321.02
8.2.30.0040.00421.05
8.2.20.0020.00518.05
8.2.10.0050.00319.81
8.2.00.0000.00717.93
8.1.280.0150.00425.92
8.1.270.0060.00322.18
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00422.20
8.1.230.0080.00320.97
8.1.220.0050.00317.78
8.1.210.0050.00319.02
8.1.200.0030.00617.48
8.1.190.0000.00817.48
8.1.180.0030.00518.95
8.1.170.0040.00418.59
8.1.160.0070.00022.19
8.1.150.0050.00318.85
8.1.140.0040.00419.61
8.1.130.0000.00717.63
8.1.120.0070.00017.55
8.1.110.0040.00417.64
8.1.100.0000.00717.68
8.1.90.0000.00817.57
8.1.80.0000.00717.61
8.1.70.0000.00717.67
8.1.60.0070.00317.70
8.1.50.0080.00017.66
8.1.40.0000.01217.72
8.1.30.0000.00917.86
8.1.20.0030.00617.66
8.1.10.0070.00317.78
8.1.00.0040.00417.68
8.0.300.0060.00320.21
8.0.290.0040.00417.13
8.0.280.0040.00418.48
8.0.270.0030.00317.34
8.0.260.0030.00317.05
8.0.250.0040.00417.19
8.0.240.0030.00317.20
8.0.230.0050.00217.21
8.0.220.0030.00416.99
8.0.210.0000.00717.05
8.0.200.0000.00717.17
8.0.190.0040.00417.15
8.0.180.0040.00417.14
8.0.170.0000.00817.14
8.0.160.0030.00317.08
8.0.150.0030.00317.05
8.0.140.0070.00016.97
8.0.130.0000.00713.63
8.0.120.0050.00317.10
8.0.110.0040.00417.18
8.0.100.0050.00317.08
8.0.90.0040.00417.11
8.0.80.0030.01217.01
8.0.70.0040.00417.11
8.0.60.0050.00216.95
8.0.50.0000.00717.18
8.0.30.0080.01017.36
8.0.20.0090.00917.40
8.0.10.0000.00717.13
8.0.00.0090.00916.95
7.4.330.0050.00015.55
7.4.320.0060.00016.83
7.4.300.0070.00016.73
7.4.290.0030.00616.63
7.4.280.0030.00616.75
7.4.270.0040.00416.73
7.4.260.0000.00716.74
7.4.250.0070.00016.84
7.4.240.0070.00016.89
7.4.230.0000.00716.65
7.4.220.0160.00316.85
7.4.210.0090.01216.61
7.4.200.0040.00416.74
7.4.160.0050.01016.74
7.4.150.0090.00917.40
7.4.140.0140.00717.86
7.4.130.0080.01116.78
7.4.120.0120.00816.72
7.4.110.0070.01016.89
7.4.100.0110.00916.72
7.4.90.0120.00616.89
7.4.80.0030.01419.39
7.4.70.0090.00916.76
7.4.60.0090.00616.69
7.4.50.0030.01216.73
7.4.40.0120.00616.78
7.4.30.0070.01016.80
7.4.00.0070.01115.29
7.3.330.0000.00513.47
7.3.320.0030.00313.41
7.3.310.0030.00316.58
7.3.300.0000.00616.57
7.3.290.0100.00516.55
7.3.280.0110.00616.54
7.3.270.0290.01117.40
7.3.260.0100.01016.57
7.3.250.0090.01016.52
7.3.240.0090.01116.62
7.3.230.0150.00316.71
7.3.210.0110.00716.55
7.3.200.0070.01016.49
7.3.190.0110.01216.59
7.3.180.0040.01316.85
7.3.170.0200.00316.54
7.3.160.0090.01516.68
7.2.330.0090.01316.80
7.2.320.0080.02516.81
7.2.310.0060.01016.86
7.2.300.0070.01316.89
7.2.290.0120.00616.90
7.2.60.0000.00717.05
7.2.50.0030.01017.27
7.2.00.0100.00319.94
7.1.200.0070.00716.00
7.1.70.0000.00817.39
7.1.60.0660.00315.63
7.1.00.0030.07722.46
7.0.200.0040.00815.00
7.0.120.0130.06022.05
7.0.110.0100.06722.08
7.0.100.0100.07722.14
7.0.90.0070.07022.15
7.0.80.0170.05722.06
7.0.70.0130.07322.05
7.0.60.0130.07022.15
7.0.50.0030.07022.07
7.0.40.0200.05322.09
7.0.30.0270.06022.08
7.0.20.0100.05722.15
7.0.10.0100.07022.07
7.0.00.0130.05322.08
5.6.270.0070.06321.09
5.6.260.0230.05321.11
5.6.250.0130.05720.98
5.6.240.0030.07721.04
5.6.230.0170.06020.74
5.6.220.0070.06320.99
5.6.210.0170.07020.97
5.6.200.0100.08020.80
5.6.190.0070.07021.02
5.6.180.0030.06320.86
5.6.170.0100.05720.83
5.6.160.0130.05321.04
5.6.150.0070.06320.75
5.6.140.0100.06020.82
5.6.130.0130.06320.83
5.6.120.0130.05721.04
5.6.110.0030.07720.98
5.6.100.0130.05720.73
5.6.90.0170.06020.88
5.6.80.0270.06320.46
5.6.70.0070.07320.39
5.6.60.0130.07320.22
5.6.50.0130.06320.21
5.6.40.0070.07320.28
5.6.30.0170.06720.30
5.6.20.0170.06020.10
5.6.10.0130.06320.41
5.6.00.0130.05320.34

preferences:
72.92 ms | 400 KiB | 5 Q