3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML This is <h2>H2 nummer 1</h2> and this is This is <h2>H2 nummer 2</h2> This is <h2>H2 nummer 3</h2> HTML; function replace_text_wps($content) { return preg_replace_callback('#<h2>(.*?)</h2>#', function ($m) { static $h2Count = 0; return sprintf('<h2 id="%s">%s</h2>', ++$h2Count, $m[1]); }, $content); } echo replace_text_wps($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.4.120.0080.01120.50
8.4.110.0050.00422.33
8.4.100.0120.00818.17
8.4.90.0130.00718.02
8.4.80.0120.00718.11
8.4.70.0050.00319.75
8.4.60.0070.00520.85
8.4.50.0060.00320.76
8.4.40.0160.00320.80
8.4.30.0110.00722.28
8.4.20.0100.01018.04
8.4.10.0030.00624.10
8.3.250.0070.00119.11
8.3.240.0130.00616.53
8.3.230.0130.00616.75
8.3.220.0050.00316.86
8.3.210.0070.00316.80
8.3.200.0070.00417.04
8.3.190.0120.00717.38
8.3.180.0120.00916.64
8.3.170.0070.01317.29
8.3.160.0090.00916.67
8.3.150.0100.01019.04
8.3.140.0080.00017.02
8.3.130.0030.00618.55
8.3.120.0080.00416.91
8.3.110.0040.00416.75
8.3.100.0080.00018.68
8.3.90.0040.00418.86
8.3.80.0030.00618.68
8.3.70.0120.00318.67
8.3.60.0100.01316.75
8.3.50.0070.00716.68
8.3.40.0070.00720.21
8.3.30.0070.00720.89
8.3.20.0060.00324.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0100.00920.43
8.2.280.0070.00219.18
8.2.270.0120.00617.31
8.2.260.0120.00316.36
8.2.250.0040.00416.73
8.2.240.0060.00319.27
8.2.230.0030.00720.94
8.2.220.0030.00624.06
8.2.210.0070.00726.77
8.2.200.0060.00318.41
8.2.190.0110.00716.88
8.2.180.0210.00016.75
8.2.170.0180.00422.96
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00421.19
8.2.110.0040.00420.35
8.2.100.0030.00918.03
8.2.90.0040.00418.14
8.2.80.0040.00418.34
8.2.70.0060.00317.88
8.2.60.0130.00717.50
8.2.50.0130.00417.63
8.2.40.0140.00517.38
8.2.30.0130.00517.75
8.2.20.0150.00317.50
8.2.10.0160.00017.25
8.2.00.0110.00617.63
8.1.330.0100.01023.83
8.1.320.0110.00816.13
8.1.310.0080.00016.91
8.1.300.0000.01020.28
8.1.290.0060.00318.88
8.1.280.0240.00325.92
8.1.270.0040.00420.71
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0000.00923.82
8.1.230.0080.00320.97
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0000.00817.48
8.1.190.0160.00017.11
8.1.180.0090.00917.25
8.1.170.0090.00917.25
8.1.160.0120.00617.13
8.1.150.0070.01017.25
8.1.140.0110.00617.23
8.1.130.0140.00217.38
8.1.120.0050.01117.25
8.1.110.0080.00817.21
8.1.100.0140.00317.38
8.1.90.0180.00017.25
8.1.80.0190.00017.36
8.1.70.0100.00717.63
8.1.60.0140.00517.48
8.1.50.0090.00917.13
8.1.40.0180.00017.50
8.1.30.0140.00417.60
8.1.20.0140.00517.10
8.1.10.0130.00517.38
8.1.00.0170.00017.25
8.0.300.0050.00219.86
8.0.290.0060.00316.88
8.0.280.0120.00616.63
8.0.270.0120.00616.75
8.0.260.0120.00416.75
8.0.250.0150.00316.75
8.0.240.0150.00417.00
8.0.230.0180.00016.71
8.0.220.0150.00416.60
8.0.210.0150.00316.75
8.0.200.0110.00716.84
8.0.190.0180.00016.52
8.0.180.0170.00016.73
8.0.170.0140.00416.59
8.0.160.0070.01116.75
8.0.150.0090.00916.73
8.0.140.0060.01116.52
8.0.130.0100.00816.72
8.0.120.0060.01216.59
8.0.110.0170.00016.52
8.0.100.0170.00016.88
8.0.90.0110.00616.59
8.0.80.0090.00916.75
8.0.70.0140.00316.63
8.0.60.0120.00316.88
8.0.50.0140.00316.63
8.0.30.0120.00416.52
8.0.20.0120.00416.75
8.0.10.0120.00616.88

preferences:
57.99 ms | 403 KiB | 5 Q