3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html=<<<doc <html> <head> <title>My page</title> <script> //<![CDATA[ $(function(){ $('.ajax').trigger('change'); }) //]]></script> <style>ul li ol li{color;red;}</style> </head> <body> <div> <ul> <li>Languages <ol> <li>PHP</li> <li class='noparse'>C++</li> </ol> </li> </ul> <span>inline text</span> <p class="generic">some long text data</p> <a href="https://stackoverflow.com" title="resource hub">Stack Overflow</a> <a href="https://google.nl" title="Google" class="inline-a noparse otherclass">Google</a> <img class="img-responsive parse round red" src="" alt="round image" /> <img class="img-responsive noparse round red" src="" alt="square image" /> </div> </body> </html> doc; libxml_use_internal_errors(true); $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadHTML($html, LIBXML_SCHEMA_CREATE); $xpath = new DOMXPath($dom); $exclude='.generic,.noparse'; foreach ($xpath->query("//*/text()[not(@class='$exclude')]|//a/@title[not(@class='$exclude')]|//img/@alt[not(@class='$exclude')]") as $node) { $node->textContent=$node->textContent.' powered by sometext'; } echo $dom->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.4.130.0120.00819.98
8.4.120.0090.01320.92
8.4.110.0080.00921.10
8.4.100.0150.00718.04
8.4.90.0090.01020.87
8.4.80.0110.01019.07
8.4.70.0120.00818.11
8.4.60.0060.01519.18
8.4.50.0070.00218.37
8.4.40.0140.00719.82
8.4.30.0160.00318.80
8.4.20.0060.00319.36
8.4.10.0060.00317.94
8.3.260.0120.01016.91
8.3.250.0100.00919.25
8.3.240.0120.00719.30
8.3.230.0080.01217.19
8.3.220.0120.00719.43
8.3.210.0090.00617.20
8.3.200.0080.01217.00
8.3.190.0100.01019.25
8.3.180.0050.00916.82
8.3.170.0100.01019.28
8.3.160.0090.00016.96
8.3.150.0060.01320.91
8.3.140.0000.02016.95
8.3.130.0110.00017.23
8.3.120.0060.00319.39
8.3.110.0070.01316.75
8.3.100.0060.00324.06
8.3.90.0080.00026.77
8.3.80.0100.01017.13
8.3.70.0090.00916.88
8.3.60.0090.00617.00
8.3.50.0120.00318.64
8.3.40.0180.00319.34
8.3.30.0130.00619.30
8.3.20.0080.00024.18
8.3.10.0050.00324.66
8.3.00.0000.00826.16
8.2.290.0070.00217.00
8.2.280.0110.00723.02
8.2.270.0140.00017.57
8.2.260.0070.01120.97
8.2.250.0090.00017.02
8.2.240.0080.00019.34
8.2.230.0120.00620.94
8.2.220.0000.00937.54
8.2.210.0040.00426.77
8.2.200.0100.00016.75
8.2.190.0100.01016.88
8.2.180.0100.01325.92
8.2.170.0090.00619.59
8.2.160.0000.01722.96
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0060.00321.44
8.2.110.0000.00920.89
8.2.100.0060.00321.07
8.1.330.0120.00616.48
8.1.320.0100.00816.62
8.1.310.0180.00017.16
8.1.300.0090.00918.80
8.1.290.0100.00018.88
8.1.280.0120.00425.92
8.1.270.0030.00524.66
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00620.95
8.1.230.0030.00719.26
7.4.210.0070.00717.12

preferences:
32.49 ms | 403 KiB | 5 Q