3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div> <img src="er" alt="aa" width="641" height="481" class="class1 class2" /> </div> HTML; $doc = new DOMDocument(); $doc->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($doc); foreach ($doc->getElementsByTagName('img') as $img) { $img->setAttribute('class', $img->getAttribute('class') . " myclass"); } echo $doc->saveHTML();

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.30.0100.00619.85
8.5.20.0080.00920.42
8.5.10.0140.01016.82
8.5.00.0130.01120.33
8.4.180.0140.00819.86
8.4.170.0140.00723.87
8.4.160.0110.01124.11
8.4.150.0090.00417.01
8.4.140.0170.00518.12
8.4.130.0060.00517.86
8.4.120.0070.00421.02
8.4.110.0130.01119.11
8.4.100.0120.00918.16
8.4.90.0110.01418.19
8.4.80.0050.00418.39
8.4.70.0060.00617.98
8.4.60.0150.00518.86
8.4.50.0040.00418.31
8.4.40.0090.00619.68
8.4.30.0070.01318.92
8.4.20.0100.01019.99
8.4.10.0030.00619.90
8.3.300.0110.01119.47
8.3.290.0120.00921.20
8.3.280.0150.00518.59
8.3.270.0130.00516.85
8.3.260.0090.01016.98
8.3.250.0110.00719.37
8.3.240.0130.00619.13
8.3.230.0100.00216.83
8.3.220.0050.00517.40
8.3.210.0090.00617.07
8.3.200.0050.00516.82
8.3.190.0060.01017.25
8.3.180.0050.00318.68
8.3.170.0060.01219.20
8.3.160.0110.00716.82
8.3.150.0000.01919.04
8.3.140.0000.01116.98
8.3.130.0030.00618.90
8.3.120.0040.00419.47
8.3.110.0060.00317.05
8.3.100.0060.00317.15
8.3.90.0130.00426.77
8.3.80.0200.00026.77
8.3.70.0090.01426.77
8.3.60.0220.00026.77
8.3.50.0120.00926.77
8.3.40.0170.00226.77
8.3.30.0160.00326.77
8.3.20.0160.00426.77
8.3.10.0110.00526.77
8.3.00.0110.00726.77
8.2.300.0140.00818.49
8.2.290.0060.00420.97
8.2.280.0040.00520.30
8.2.270.0040.01417.42
8.2.260.0000.00817.26
8.2.250.0090.00616.97
8.2.240.0120.00619.32
8.2.230.0040.00420.94
8.2.220.0050.00324.06
8.2.210.0050.00326.77
8.2.200.0150.00326.77
8.2.190.0130.00426.77
8.2.180.0150.00226.77
8.2.170.0140.00526.77
8.2.160.0130.00726.77
8.2.150.0180.00026.77
8.2.140.0160.00426.77
8.2.130.0150.00626.77
8.2.120.0140.00426.77
8.2.110.0180.00026.77
8.2.100.0090.00926.77
8.2.90.0140.00726.77
8.2.80.0170.00326.77
8.2.70.0190.00026.77
8.2.60.0100.01026.77
8.2.50.0140.00426.77
8.2.40.0140.00326.77
8.2.30.0170.00026.77
8.2.20.0080.00326.77
8.2.10.0180.00026.77
8.2.00.0170.00026.77
8.1.340.0110.00917.85
8.1.330.0110.00917.04
8.1.320.0100.00816.38
8.1.310.0090.00617.02
8.1.300.0060.00318.54
8.1.290.0170.00626.77
8.1.280.0170.00026.77
8.1.270.0170.00326.77
8.1.260.0170.00226.77
8.1.250.0160.00226.77
8.1.240.0140.00426.77
8.1.230.0100.00526.77
8.1.220.0130.00426.77
8.1.210.0140.00326.77
8.1.200.0100.00726.77
8.1.190.0080.00826.77
8.1.180.0100.00726.77
8.1.170.0110.00526.77
8.1.160.0160.00026.77
8.1.150.0100.00726.77
8.1.140.0140.00326.77
8.1.130.0140.00326.77
8.1.120.0170.00026.77
8.1.110.0120.00426.77
8.1.100.0130.00426.77
8.1.90.0130.00326.77
8.1.80.0180.00026.77
8.1.70.0140.00326.77
8.1.60.0160.00326.77
8.1.50.0150.00326.77
8.1.40.0120.00626.77
8.1.30.0150.00326.77
8.1.20.0110.00726.77
8.1.10.0210.00026.77
8.1.00.0100.01026.77

preferences:
43.55 ms | 991 KiB | 5 Q