3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = json_decode('[ {"title":"Title #1", "text":"Text #1"}, {"title":"Title #2", "text":"Text #2"} ]'); $itemTmpl = "<h3 class='foo'>{title}</h3><div class='bar'>{text}</div>"; $html = []; foreach ($items as $item) { $html[] = preg_replace_callback( '/{([a-z]+)}/', fn($m) => $item->{$m[1]}, $itemTmpl ); } var_export($html);

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.0150.00717.13
8.3.50.0120.00318.75
8.3.40.0140.00720.01
8.3.30.0140.00019.05
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0000.00826.16
8.2.180.0140.00725.92
8.2.170.0120.00919.21
8.2.160.0080.00622.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0090.00026.16
8.2.120.0050.00320.87
8.2.110.0030.00620.39
8.2.100.0110.00018.02
8.2.90.0050.00317.75
8.2.80.0030.00618.94
8.2.70.0050.00317.88
8.2.60.0060.00318.03
8.2.50.0030.00718.07
8.2.40.0050.00318.28
8.2.30.0000.00718.25
8.2.20.0040.00422.55
8.2.10.0040.00418.15
8.2.00.0070.00019.42
8.1.280.0070.00725.92
8.1.270.0070.00024.66
8.1.260.0110.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00021.25
8.1.230.0040.00720.96
8.1.220.0040.00417.77
8.1.210.0060.00318.77
8.1.200.0030.00717.36
8.1.190.0060.00317.36
8.1.180.0060.00318.10
8.1.170.0030.00618.63
8.1.160.0040.00418.98
8.1.150.0060.00318.81
8.1.140.0040.00417.54
8.1.130.0000.00717.63
8.1.120.0130.00317.68
8.1.110.0140.00217.74
8.1.100.0170.00017.59
8.1.90.0160.00417.73
8.1.80.0190.00017.59
8.1.70.0110.00517.75
8.1.60.0130.00617.73
8.1.50.0100.00517.65
8.1.40.0130.00617.77
8.1.30.0100.01017.82
8.1.20.0160.00317.82
8.1.10.0090.00917.76
8.1.00.0070.00519.51
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.61
8.0.270.0000.00718.07
8.0.260.0030.00316.90
8.0.250.0000.01218.77
8.0.240.0130.00717.04
8.0.230.0140.00317.16
8.0.220.0140.00216.95
8.0.210.0110.00717.04
8.0.200.0060.00916.94
8.0.190.0110.00316.96
8.0.180.0110.00717.03
8.0.170.0150.00017.07
8.0.160.0100.00617.03
8.0.150.0050.01116.84
8.0.140.0050.01016.88
8.0.130.0120.00316.88
8.0.120.0080.00816.97
8.0.110.0000.01616.96
8.0.100.0090.00816.87
8.0.90.0130.00316.96
8.0.80.0060.01116.92
8.0.70.0110.00416.88
8.0.60.0120.00416.93
8.0.50.0050.01016.94
8.0.30.0110.00516.87
8.0.20.0100.00517.04
8.0.10.0130.00417.07
7.4.330.0100.00315.55
7.4.320.0110.00416.77
7.4.300.0170.00016.67
7.4.290.0150.00416.56
7.4.280.0120.00616.57
7.4.270.0120.00416.74
7.4.260.0090.00816.75
7.4.250.0200.00016.61
7.4.240.0090.00916.75
7.4.230.0170.00016.68
7.4.220.0060.00316.59
7.4.210.0040.00816.68
7.4.200.0040.00418.35
7.4.190.0080.00516.68
7.4.180.0060.00318.52
7.4.160.0120.00316.81
7.4.150.0100.00516.73
7.4.140.0140.00016.64
7.4.130.0110.00416.74
7.4.120.0080.00816.69
7.4.110.0100.00516.73
7.4.100.0160.00016.65
7.4.90.0110.00316.56
7.4.80.0120.00316.70
7.4.70.0100.00516.74
7.4.60.0110.00316.57
7.4.50.0090.00516.60
7.4.40.0120.00416.66
7.4.30.0100.00516.74
7.4.20.0130.00016.48
7.4.10.0140.00016.58
7.4.00.0060.00616.64

preferences:
47.32 ms | 400 KiB | 5 Q