3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ ['href' => 'https://www.php.net/', 'name' => 'PHP.net'], ['href' => 'https://stackoverflow.com/', 'name' => 'Stack Overflow'], ['href' => 'https://www.google.com/', 'name' => 'Google'] ]; $rows_by_href = array_reduce($rows, function ($rows_by_href, $row) { $rows_by_href[$row['href']] = $row['name']; return $rows_by_href; }, []); $string = "<a href='https://www.php.net/'>https://www.php.net/</a> <a href='https://stackoverflow.com/'>https://stackoverflow.com/</a> <a href='https://www.google.com/'>https://www.google.com/</a>"; $pattern = "/<a href='(?<href>.+?)'>(?<name>.+?)<\/a>/i"; $result = preg_replace_callback($pattern, function ($matches) use ($rows_by_href) { return "<a href='" . $matches['href'] . "'>" . ($rows_by_href[$matches['href']] ?? $matches['name']) . "</a>"; }, $string); echo $result;

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.4.140.0100.01217.89
8.4.130.0130.00818.07
8.4.120.0150.00620.44
8.4.110.0050.00422.46
8.4.100.0100.01218.63
8.4.90.0120.00718.76
8.4.80.0110.00918.14
8.4.70.0050.00318.00
8.4.60.0140.00718.59
8.4.50.0120.00818.27
8.4.40.0090.00919.76
8.4.30.0090.00924.15
8.4.20.0070.00318.93
8.4.10.0040.00417.82
8.3.270.0130.00916.68
8.3.260.0040.00416.61
8.3.250.0130.00619.14
8.3.240.0080.01017.15
8.3.230.0070.00616.86
8.3.220.0130.00719.06
8.3.210.0070.00316.91
8.3.200.0110.00718.88
8.3.190.0050.00419.15
8.3.180.0130.00916.84
8.3.170.0150.00417.10
8.3.160.0100.01016.83
8.3.150.0060.01318.91
8.3.140.0090.00017.29
8.3.130.0050.00318.61
8.3.120.0090.00019.07
8.3.110.0100.01020.94
8.3.100.0040.00724.06
8.3.90.0040.00426.77
8.3.80.0070.00318.68
8.3.70.0190.00316.61
8.3.60.0120.00618.47
8.3.50.0140.00219.16
8.3.40.0130.00318.87
8.3.30.0070.00718.92
8.3.20.0080.00020.83
8.3.10.0080.00023.65
8.3.00.0040.00422.40
8.2.290.0080.01020.48
8.2.280.0120.00718.46
8.2.270.0150.00416.86
8.2.260.0040.01120.86
8.2.250.0040.00416.91
8.2.240.0160.00317.30
8.2.230.0100.01022.58
8.2.220.0130.00337.54
8.2.210.0090.00626.77
8.2.200.0070.00416.88
8.2.190.0040.01416.75
8.2.180.0080.00825.92
8.2.170.0070.00722.96
8.2.160.0070.00720.34
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0000.00826.16
8.2.110.0030.00720.48
8.2.100.0090.00317.91
8.2.90.0080.00018.15
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0000.00918.05
8.2.50.0040.00418.07
8.2.40.0080.00020.20
8.2.30.0070.00318.25
8.2.20.0040.00418.36
8.2.10.0000.00719.43
8.2.00.0030.00618.36
8.1.330.0130.00622.28
8.1.320.0140.00416.57
8.1.310.0040.00418.64
8.1.300.0060.01320.04
8.1.290.0040.00430.84
8.1.280.0030.01125.92
8.1.270.0090.00022.08
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00319.23
8.1.230.0060.01020.97
8.1.220.0000.00817.78
8.1.210.0000.00818.87
8.1.200.0060.00317.35
8.1.190.0060.00317.35
8.1.180.0030.00618.10
8.1.170.0030.00618.83
8.1.160.0000.00718.84
8.1.150.0030.00518.82
8.1.140.0050.00219.00
8.1.130.0040.00417.73
8.1.120.0040.00417.64
8.1.110.0070.00017.70
8.1.100.0060.00317.61
8.1.90.0030.00517.63
8.1.80.0040.00417.66
8.1.70.0090.00017.70
8.1.60.0080.00017.76
8.1.50.0040.00417.65
8.1.40.0000.00917.71
8.1.30.0030.00617.70
8.1.20.0060.00317.79
8.1.10.0060.00317.66
8.1.00.0000.00817.57
8.0.300.0040.00419.85
8.0.290.0000.00716.75
8.0.280.0000.00718.38
8.0.270.0060.00316.97
8.0.260.0030.00616.96
8.0.250.0040.00417.07
8.0.240.0050.00317.09
8.0.230.0000.00716.97
8.0.220.0030.00316.91
8.0.210.0000.00716.98
8.0.200.0060.00017.09
8.0.190.0000.00816.99
8.0.180.0080.00017.05
8.0.170.0030.00617.02
8.0.160.0050.00317.13
8.0.150.0000.00716.94
8.0.140.0050.00316.99
8.0.130.0030.00313.40
8.0.120.0060.00317.05
8.0.110.0040.00417.09
8.0.100.0000.00717.07
8.0.90.0040.00416.99
8.0.80.0050.01217.02
8.0.70.0000.00716.86
8.0.60.0040.00416.88
8.0.50.0000.00817.00
8.0.30.0140.00517.14
8.0.20.0120.00817.30
8.0.10.0000.00717.09
8.0.00.0130.00516.98
7.4.330.0000.00516.86
7.4.320.0000.00616.63
7.4.300.0030.00316.59
7.4.290.0000.00816.85
7.4.280.0000.00816.82
7.4.270.0000.00716.67
7.4.260.0040.00316.70
7.4.250.0030.00316.77
7.4.240.0040.00416.70
7.4.230.0030.00316.77
7.4.220.0040.00416.73
7.4.210.0080.00716.76
7.4.200.0040.00416.89
7.4.160.0110.00616.67
7.4.130.0090.00916.61
7.4.120.0090.00916.81
7.4.110.0090.00916.79
7.4.100.0030.01416.79
7.4.90.0070.01016.81
7.4.80.0130.00419.39
7.4.70.0060.01216.68
7.4.60.0100.00616.87
7.4.50.0060.00916.57
7.4.40.0030.01516.63
7.4.00.0110.00315.15
7.3.330.0040.00413.53
7.3.320.0000.00513.52
7.3.310.0000.00716.37
7.3.300.0030.00316.39
7.3.290.0060.00916.50
7.3.280.0060.01216.46
7.3.260.0130.00516.63
7.3.240.0090.00716.69
7.3.230.0030.01516.50
7.3.210.0060.01216.75
7.3.200.0090.00616.45
7.3.190.0070.01416.81
7.3.180.0060.01316.59
7.3.170.0170.00616.94
7.3.160.0050.01316.55
7.3.40.0040.01714.81
7.3.30.0060.00714.82
7.3.20.0000.01116.63
7.3.10.0100.00316.70
7.3.00.0170.00616.52
7.2.330.0030.01416.62
7.2.320.0110.00716.66
7.2.310.0120.00417.03
7.2.300.0140.00416.68
7.2.290.0160.00016.91
7.2.170.0110.00815.28
7.2.160.0000.01114.97
7.2.150.0060.01617.22
7.2.140.0110.00017.05
7.2.130.0060.00916.83
7.2.120.0130.00317.20
7.2.110.0120.01016.90
7.2.100.0060.00617.07
7.2.90.0030.00717.18
7.2.80.0080.00417.12
7.2.70.0030.00917.26
7.2.60.0090.00316.86
7.2.50.0040.01116.89
7.2.40.0110.00417.02
7.2.30.0040.00716.84
7.2.20.0040.01116.96
7.2.10.0080.00416.92
7.2.00.0030.01017.04
7.1.280.0100.01015.80
7.1.270.0000.01016.05
7.1.260.0110.01115.86
7.1.250.0090.00616.05

preferences:
32.12 ms | 403 KiB | 5 Q