3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = <<<'__HTML' <html xmlns:v="urn:schemas-microsoft-com:vml"... other xmlns> <head> <meta tags, title, styles, a couple comments too (they are irrelevant to the question)> </head> <body lang=EN-US link=blue vlink=purple style='tab-interval:36.0pt'> <div class=WordSection1> <h1>Pros and Cons of a Website</h1> <p class=MsoBodyText align=left style='a long irrelevant list'><span style='long list'><o:p>&nbsp;</o:p></span></p>(this is a sample of what it uses as line breaks. Take note of the <o:p> tag). <p class=MsoBodyText style='margin-right:5.75pt;line-height:115%'> A<span style='letter-spacing:.05pt'> </span>SAMPLE<span style='letter-spacing:.05pt'> </span>TEXT </p> </div> <div class=WordSection2>...same pattern in div 1</div> <div class=WordSection3>...same...</div> </body> </html><html xmlns:v="urn:schemas-microsoft-com:vml"... other xmlns> <head> <meta tags, title, styles, a couple comments too (they are irrelevant to the question)> </head> <body lang=EN-US link=blue vlink=purple style='tab-interval:36.0pt'> <div class=WordSection1> <h1>Pros and Cons of a Website</h1> <p class=MsoBodyText align=left style='a long irrelevant list'><span style='long list'><o:p>&nbsp;</o:p></span></p>(this is a sample of what it uses as line breaks. Take note of the <o:p> tag). <p class=MsoBodyText style='margin-right:5.75pt;line-height:115%'> A<span style='letter-spacing:.05pt'> </span>SAMPLE<span style='letter-spacing:.05pt'> </span>TEXT </p> </div> <div class=WordSection2>...same pattern in div 1</div> <div class=WordSection3>...same...</div> </body> </html> __HTML; libxml_use_internal_errors(true); $doc = new DomDocument(); $doc->loadHTML($html); foreach ($doc->getElementsByTagName('div') as $div) { $raw = $div->textContent; $text = trim(preg_replace('/\s+/', ' ', $raw)); var_dump($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.60.0120.00617.29
8.5.30.0110.00818.26
8.5.20.0110.00920.41
8.5.10.0080.01017.10
8.5.00.0150.00920.49
8.4.180.0160.00622.36
8.4.170.0150.00720.73
8.4.160.0100.01220.87
8.4.150.0080.00417.13
8.4.140.0110.01017.85
8.4.130.0100.01118.83
8.4.120.0160.00520.28
8.4.110.0150.00618.20
8.4.100.0120.00918.11
8.4.90.0150.00520.81
8.4.80.0120.00920.87
8.4.70.0120.00618.85
8.4.60.0110.00920.88
8.4.50.0130.00720.78
8.4.40.0130.00617.96
8.4.30.0250.01018.96
8.4.20.0220.00017.61
8.4.10.0170.00317.79
8.3.300.0100.01320.90
8.3.290.0080.00321.23
8.3.280.0150.00818.91
8.3.270.0110.00916.92
8.3.260.0110.00916.88
8.3.250.0130.00717.32
8.3.240.0100.01016.85
8.3.230.0130.00717.07
8.3.220.0110.00419.13
8.3.210.0090.01017.00
8.3.200.0050.00317.01
8.3.190.0080.01017.50
8.3.180.0100.00919.21
8.3.170.0080.00017.42
8.3.160.0030.00517.48
8.3.150.0160.00416.56
8.3.140.0160.00616.53
8.3.130.0150.00316.99
8.3.120.0120.00717.11
8.3.110.0000.01616.69
8.3.100.0170.00317.05
8.3.90.0150.00716.59
8.3.80.0200.00016.63
8.3.70.0120.00916.78
8.3.60.0170.00616.89
8.3.50.0220.00017.02
8.3.40.0140.00517.91
8.3.30.0170.00317.61
8.3.20.0160.00317.73
8.3.10.0120.00417.96
8.3.00.0070.00318.09
8.2.300.0140.00820.65
8.2.290.0140.00517.13
8.2.280.0140.00618.65
8.2.270.0130.00516.87
8.2.260.0130.00316.64
8.2.250.0040.01317.19
8.2.240.0140.00316.73
8.2.230.0140.00316.82
8.2.220.0160.00416.69
8.2.210.0130.00616.77
8.2.200.0050.01116.63
8.2.190.0190.00016.93
8.2.180.0100.00716.43
8.2.170.0160.00317.91
8.2.160.0130.00417.81
8.2.150.0200.00017.77
8.2.140.0180.00017.66
8.2.130.0190.00017.62
8.2.120.0160.00317.63
8.2.110.0130.00517.59
8.2.100.0140.00517.74
8.2.90.0140.00317.84
8.2.80.0150.00217.58
8.2.70.0100.00717.55
8.2.60.0150.00317.57
8.2.50.0120.00617.53
8.2.40.0140.00217.59
8.2.30.0130.00717.48
8.2.20.0130.00517.27
8.2.10.0110.00517.53
8.2.00.0130.00317.76
8.1.340.0140.00920.55
8.1.320.0090.00616.38

preferences:
55.21 ms | 877 KiB | 5 Q