3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "/\[([^][|]+)(?:\|([^][]+))?\]/"; $s = "This is an example definition. Here is a link to [foo]. This is an [aliased link|bar]."; $s = preg_replace_callback($pattern, function($match){ $template = '<a href="%s">%s</a>'; return sprintf($template, array_key_exists(2, $match) ? $match[2] : $match[1], $match[1]); }, $s); echo $s;

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.10.0080.01016.65
8.5.00.0070.01420.13
8.4.150.0020.00014.05
8.4.140.0150.00617.78
8.4.130.0070.00317.71
8.4.120.0050.00720.88
8.4.110.0160.00320.60
8.4.100.0100.01018.86
8.4.90.0090.01118.84
8.4.80.0050.00417.99
8.4.70.0090.01118.08
8.4.60.0150.00518.83
8.4.50.0130.00719.68
8.4.40.0110.00717.90
8.4.30.0070.01420.53
8.4.20.0120.00819.80
8.4.10.0060.00917.86
8.3.280.0100.01218.56
8.3.270.0110.00916.60
8.3.260.0110.00916.75
8.3.250.0100.00918.81
8.3.240.0090.01016.87
8.3.230.0110.00816.73
8.3.220.0040.00419.05
8.3.210.0120.00716.86
8.3.200.0120.00816.70
8.3.190.0110.00717.17
8.3.180.0130.00516.59
8.3.170.0120.00616.82
8.3.160.0120.00617.05
8.3.150.0060.01217.24
8.3.140.0050.00317.00
8.3.130.0000.00918.38
8.3.120.0130.00318.93
8.3.110.0060.00320.94
8.3.100.0000.01017.06
8.3.90.0080.00026.77
8.3.80.0070.00416.75
8.3.70.0150.00416.88
8.3.60.0090.00616.75
8.3.50.0140.00716.79
8.3.40.0180.00419.04
8.3.30.0070.00718.98
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0080.00520.58
8.2.280.0120.00918.45
8.2.270.0040.01416.76
8.2.260.0060.00319.13
8.2.250.0060.01316.58
8.2.240.0170.00317.28
8.2.230.0060.00322.58
8.2.220.0100.00724.06
8.2.210.0100.00026.77
8.2.200.0030.00616.75
8.2.190.0180.00316.58
8.2.180.0120.00925.92
8.2.170.0140.00419.08
8.2.160.0090.00422.96
8.2.150.0000.00825.66
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00819.10
8.2.110.0030.00621.06
8.2.100.0110.00019.38
8.2.90.0040.00420.55
8.2.80.0040.00420.35
8.2.70.0040.00417.74
8.2.60.0050.00317.90
8.2.50.0040.00418.05
8.2.40.0040.00418.16
8.2.30.0060.00318.18
8.2.20.0040.00418.04
8.2.10.0060.00319.28
8.2.00.0000.00819.26
8.1.330.0030.00522.22
8.1.320.0090.01016.30
8.1.310.0000.00817.03
8.1.300.0080.00018.57
8.1.290.0080.00430.84
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0050.00522.13
8.1.230.0080.00320.89
8.1.220.0000.00917.74
8.1.210.0080.00018.85
8.1.200.0030.00617.48
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0040.00418.71
8.1.160.0040.00419.11
8.1.150.0040.00418.98
8.1.140.0000.00719.00
8.1.130.0000.00717.67
8.1.120.0030.00517.53
8.1.110.0000.00717.61
8.1.100.0000.00717.54
8.1.90.0000.00817.63
8.1.80.0060.00617.51
8.1.70.0000.00717.64
8.1.60.0000.00717.81
8.1.50.0080.00017.65
8.1.40.0000.00817.71
8.1.30.0090.00017.78
8.1.20.0000.00917.88
8.1.10.0000.00817.65
8.1.00.0060.00617.70
8.0.300.0040.00420.00
8.0.290.0040.00416.88
8.0.280.0030.00518.47
8.0.270.0030.00518.18
8.0.260.0030.00316.93
8.0.250.0050.00317.01
8.0.240.0000.00717.07
8.0.230.0080.00016.98
8.0.220.0000.00716.88
8.0.210.0000.00717.00
8.0.200.0030.00316.99
8.0.190.0030.00617.04
8.0.180.0040.00416.96
8.0.170.0060.00317.11
8.0.160.0000.00917.06
8.0.150.0040.00417.04
8.0.140.0040.00317.06
8.0.130.0000.00613.50
8.0.120.0060.00316.94
8.0.110.0080.00016.96
8.0.100.0000.00717.07
8.0.90.0000.00717.04
8.0.80.0100.00917.07
8.0.70.0000.00717.00
8.0.60.0020.00517.06
8.0.50.0030.00517.01
8.0.30.0060.01617.10
8.0.20.0090.00917.05
8.0.10.0210.00017.12
8.0.00.0120.01217.19
7.4.330.0000.00515.55
7.4.320.0000.00616.83
7.4.300.0030.00316.88
7.4.290.0030.00316.63
7.4.280.0000.00816.73
7.4.270.0030.00316.58
7.4.260.0000.00513.52
7.4.250.0000.00716.63
7.4.240.0050.00216.75
7.4.230.0070.00016.92
7.4.220.0040.00316.63
7.4.210.0050.00816.83
7.4.200.0030.00316.61
7.4.160.0120.00916.91
7.4.150.0190.00316.81
7.4.140.0070.01616.73
7.4.130.0090.01316.64
7.4.120.0100.00716.77
7.4.110.0070.00716.89
7.4.100.0050.01616.89
7.4.90.0030.01216.64
7.4.80.0070.01016.77
7.4.70.0130.00316.79
7.4.60.0110.01116.93
7.4.50.0090.01316.62
7.4.40.0070.01316.70
7.4.30.0140.00616.77
7.4.20.0070.01016.73
7.4.10.0060.00916.54
7.4.00.0030.01016.78
7.3.330.0040.00416.55
7.3.320.0000.00513.52
7.3.310.0070.00016.35
7.3.300.0050.00216.54
7.3.290.0060.00916.45
7.3.270.0090.01216.50
7.3.260.0070.00716.56
7.3.250.0090.01316.34
7.3.240.0060.01216.34
7.3.230.0090.01216.45
7.3.220.0070.01416.46
7.3.210.0060.00916.52
7.3.200.0040.01816.44
7.3.190.0050.00916.45
7.3.180.0190.00316.43
7.3.170.0060.01316.45
7.3.160.0110.00716.50
7.3.150.0150.00016.38
7.3.140.0110.00316.45
7.3.130.0030.01216.48
7.3.120.0140.00016.47
7.3.110.0070.00716.39
7.3.100.0070.00716.34
7.3.90.0130.00016.69
7.3.80.0130.00416.52
7.3.70.0070.00716.58
7.3.60.0070.00716.54
7.3.50.0070.00716.62
7.3.40.0130.00316.64
7.3.30.0030.01316.60
7.3.20.0090.00616.63
7.3.10.0000.01416.64
7.3.00.0120.00416.58

preferences:
19.37 ms | 403 KiB | 5 Q