3v4l.org

run code in 300+ PHP versions simultaneously
<?php $patternCallbacks = [ '~\[code](.*?)\[/code]~is' => function($m) { return '[code]' . base64_encode($m[1]) . '[/code]'; }, '~\[php(?:=[0-9]+)?]\K(.*?)\[/php]~is' => function($m) { return base64_encode($m[1]) . '[/php]'; }, ]; $text = <<<TEXT This is my [code]script[/code] to display. It has [php]unnumbered tag code[/php] and [php=8]numbered tag code[/php].' TEXT; foreach ($patternCallbacks as $pattern => $callback) { $text = preg_replace_callback($pattern, $callback, $text); } echo $text;

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.00.0130.01020.23
8.4.150.0020.00014.05
8.4.140.0100.01117.91
8.4.130.0030.00719.72
8.4.120.0130.00420.77
8.4.110.0120.00818.83
8.4.100.0100.01018.88
8.4.90.0100.01020.45
8.4.80.0070.00319.18
8.4.70.0060.00920.79
8.4.60.0110.00918.80
8.4.50.0030.00518.62
8.4.40.0140.01117.69
8.4.30.0150.00420.16
8.4.20.0000.00920.02
8.4.10.0090.00017.88
8.3.280.0130.00720.33
8.3.270.0110.00816.58
8.3.260.0130.00616.62
8.3.250.0110.00818.91
8.3.240.0100.00916.94
8.3.230.0100.01016.84
8.3.220.0090.01018.88
8.3.210.0090.00716.95
8.3.200.0130.00716.74
8.3.190.0090.01016.78
8.3.180.0120.00719.04
8.3.170.0120.00616.91
8.3.160.0000.00817.54
8.3.150.0160.00317.34
8.3.140.0090.00918.89
8.3.130.0060.00318.54
8.3.120.0080.00818.99
8.3.110.0000.00816.79
8.3.100.0060.00316.90
8.3.90.0050.00526.77
8.3.80.0110.00016.88
8.3.70.0110.00716.58
8.3.60.0190.00318.55
8.3.50.0090.00920.33
8.3.40.0040.01619.08
8.3.30.0090.00918.88
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0130.00720.65
8.2.280.0140.00720.34
8.2.270.0000.00816.73
8.2.260.0060.00316.93
8.2.250.0050.00316.69
8.2.240.0080.00816.70
8.2.230.0030.00520.94
8.2.220.0050.00324.06
8.2.210.0050.00326.77
8.2.200.0040.00416.63
8.2.190.0090.00616.63
8.2.180.0100.01025.92
8.2.170.0070.01319.21
8.2.160.0110.00422.96
8.2.150.0000.00825.66
8.2.140.0070.00024.66
8.2.130.0050.00326.16
8.2.120.0090.00018.96
8.2.110.0030.00622.11
8.2.100.0090.00317.84
8.2.90.0030.00517.75
8.2.80.0040.00419.04
8.2.70.0040.00417.73
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0040.00420.15
8.2.30.0040.00418.04
8.2.20.0050.00220.48
8.2.10.0000.00817.96
8.2.00.0050.00219.33
8.1.330.0080.01121.88
8.1.320.0150.00516.38
8.1.310.0030.00616.34
8.1.300.0040.01119.99
8.1.290.0000.01230.84
8.1.280.0180.00425.92
8.1.270.0220.00022.13
8.1.260.0120.00626.35
8.1.250.0180.00028.09
8.1.240.0030.00720.44
8.1.230.0080.00317.82
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0090.00017.48
8.1.190.0040.00417.38
8.1.180.0040.00418.10
8.1.170.0000.00818.61
8.1.160.0050.00218.93
8.1.150.0070.00018.82
8.1.140.0060.00317.53
8.1.130.0000.00720.36
8.1.120.0000.00817.53
8.1.110.0000.00817.66
8.1.100.0040.00417.52
8.1.90.0040.00417.52
8.1.80.0040.00417.66
8.1.70.0040.00417.57
8.1.60.0040.00417.77
8.1.50.0080.00017.69
8.1.40.0040.00417.73
8.1.30.0030.00817.79
8.1.20.0240.00317.89
8.1.10.0210.00417.75
8.1.00.0190.00617.52
8.0.300.0060.00618.77
8.0.290.0000.00817.00
8.0.280.0040.00420.25
8.0.270.0040.00418.19
8.0.260.0030.00318.34
8.0.250.0000.00817.13
8.0.240.0040.00417.18
8.0.230.0070.00017.11
8.0.220.0070.00017.00
8.0.210.0050.00217.13
8.0.200.0070.00017.05
8.0.190.0050.00317.07
8.0.180.0030.00517.19
8.0.170.0000.00917.02
8.0.160.0030.00617.13
8.0.150.0200.00016.97
8.0.140.0150.00516.93
8.0.130.0150.00617.05
8.0.120.0160.00417.05
8.0.110.0150.00516.93
8.0.100.0120.00917.07
8.0.90.0160.00417.08
8.0.80.0200.00017.13
8.0.70.0120.00916.88
8.0.60.0200.00017.05
8.0.50.0170.00417.09
8.0.30.0180.00217.09
8.0.20.0180.00317.07
8.0.10.0150.00617.06
7.4.330.0000.00515.55
7.4.320.0040.00416.81
7.4.300.0070.00016.72
7.4.290.0060.00316.63
7.4.280.0050.00316.80
7.4.270.0160.00816.68
7.4.260.0190.00616.79
7.4.250.0290.00416.81
7.4.240.0190.00616.71
7.4.230.0150.00816.69
7.4.220.0100.01016.73
7.4.210.0140.00516.73
7.4.200.0110.00816.78
7.4.190.0130.00516.88
7.4.180.0190.00016.83
7.4.160.0150.00416.68
7.4.150.0130.00516.78
7.4.140.0210.00016.77
7.4.130.0160.00416.74
7.4.120.0150.00416.71
7.4.110.0170.00216.83
7.4.100.0160.00416.71
7.4.90.0160.00316.56
7.4.80.0160.00416.84
7.4.70.0200.00016.63
7.4.60.0130.00516.82
7.4.50.0140.00516.74
7.4.40.0130.00616.56
7.4.30.0050.01316.56
7.4.20.0110.00816.67
7.4.10.0180.00016.68
7.4.00.0180.00016.66

preferences:
125.78 ms | 403 KiB | 5 Q