3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<book pages="2"> <page n="1" /> <entry> One </entry> <entry> Two </entry> <entry> Three </entry> <page n="2" /> <entry> Ten </entry> <entry> Eleven </entry> <entry> Twelve </entry> <endpages /> </book>'; $pageNo = 2; $dom = new DOMDocument("1.0", "UTF-8"); $dom->loadXML($xml); $xp = new DOMXPath($dom); $list = $xp->query("/book/page[@n='" . $pageNo . "']/following-sibling::*"); foreach ($list as $node) { if ($node->nodeName == 'page' || $node->nodeName == 'endpages') { break; } printf("%s\n", $node->textContent); }

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.0070.01116.72
8.3.50.0060.00916.71
8.3.40.0190.00318.92
8.3.30.0090.00618.96
8.3.20.0000.00820.18
8.3.10.0040.00424.08
8.3.00.0000.00822.10
8.2.180.0110.00416.86
8.2.170.0120.00922.96
8.2.160.0090.00620.89
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00422.55
8.2.120.0040.00426.35
8.2.110.0070.00319.68
8.2.100.0090.00318.09
8.2.90.0080.00019.55
8.2.80.0000.00817.97
8.2.70.0080.00017.86
8.2.60.0030.00618.18
8.2.50.0060.00318.59
8.2.40.0080.00020.98
8.2.30.0040.00419.54
8.2.20.0000.00718.40
8.2.10.0000.00718.45
8.2.00.0060.00318.46
8.1.280.0110.00425.92
8.1.270.0060.00322.47
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00023.00
8.1.230.0110.00018.20
8.1.220.0060.00318.14
8.1.210.0080.00018.77
8.1.200.0060.00317.60
8.1.190.0050.00317.80
8.1.180.0040.00418.10
8.1.170.0040.00419.15
8.1.160.0040.00419.20
8.1.150.0000.00719.23
8.1.140.0080.00019.95
8.1.130.0000.00719.20
8.1.120.0000.00717.94
8.1.110.0000.00817.65
8.1.100.0000.00717.94
8.1.90.0030.00617.95
8.1.80.0040.00417.72
8.1.70.0040.00817.89
8.1.60.0000.00918.03
8.1.50.0060.00317.95
8.1.40.0030.00517.80
8.1.30.0040.00417.96
8.1.20.0080.00017.84
8.1.10.0000.00917.84
8.1.00.0020.00517.88
8.0.300.0040.00421.05
8.0.290.0040.00417.13
8.0.280.0040.00418.84
8.0.270.0050.00517.40
8.0.260.0080.00017.29
8.0.250.0080.00017.22
8.0.240.0000.00717.41
8.0.230.0000.00717.18
8.0.220.0030.00317.35
8.0.210.0000.00717.30
8.0.200.0070.00017.21
8.0.190.0000.00817.21
8.0.180.0040.00417.26
8.0.170.0040.00417.34
8.0.160.0030.00617.27
8.0.150.0070.00417.17
8.0.140.0040.00417.31
8.0.130.0000.00513.80
8.0.120.0050.00517.05
8.0.110.0000.00817.23
8.0.100.0000.00717.32
8.0.90.0050.00317.41
8.0.80.0090.00917.34
8.0.70.0040.00417.20
8.0.60.0030.00517.35
8.0.50.0040.00417.23
8.0.30.0050.01317.34
8.0.20.0120.00917.42
8.0.10.0040.00417.36
8.0.00.0030.01517.36
7.4.330.0000.00715.55
7.4.320.0060.00017.02
7.4.300.0030.00316.80
7.4.290.0050.00216.88
7.4.280.0080.00016.86
7.4.270.0000.00717.03
7.4.260.0030.00616.83
7.4.250.0000.00716.89
7.4.240.0000.00817.04
7.4.230.0070.00016.93
7.4.220.0090.00916.88
7.4.210.0110.00516.96
7.4.200.0030.00516.76
7.4.160.0090.00916.84
7.4.150.0030.01417.40
7.4.140.0120.00817.86
7.4.130.0100.00916.84
7.4.120.0100.01016.97
7.4.110.0070.01316.79
7.4.100.0100.00616.84
7.4.90.0060.01216.85
7.4.80.0160.00819.39
7.4.70.0070.01516.89
7.4.60.0100.00616.98
7.4.50.0060.01016.91
7.4.40.0060.01216.96
7.4.30.0090.00816.96
7.4.00.0090.00615.01
7.3.330.0030.00313.38
7.3.320.0000.00613.53
7.3.310.0030.00316.68
7.3.300.0030.00316.51
7.3.290.0000.00716.71
7.3.280.0070.01116.70
7.3.270.0130.00317.40
7.3.260.0060.01116.76
7.3.250.0070.01116.61
7.3.240.0120.00916.80
7.3.230.0100.00616.74
7.3.210.0130.00916.98
7.3.200.0110.00516.67
7.3.190.0130.00916.57
7.3.180.0090.01216.60
7.3.170.0040.01216.79
7.3.160.0130.01016.80
7.2.330.0100.00717.14
7.2.320.0030.01717.20
7.2.310.0100.01417.08
7.2.300.0100.01516.92
7.2.290.0080.00817.16
7.2.60.0070.00716.97
7.1.200.0070.00715.77
7.1.110.0070.00718.63
7.1.100.0080.00818.22
7.1.90.0080.00818.04
7.1.80.0030.01018.46
7.1.70.0080.00417.27
7.1.60.0130.01635.37
7.1.50.0140.01434.74
7.1.40.0180.00734.56
7.1.30.0150.00934.66
7.1.20.0190.01034.84
7.1.10.0000.01216.79
7.1.00.0060.00616.80
7.0.250.0090.00717.79
7.0.240.0030.01017.91
7.0.230.0070.01017.72
7.0.220.0070.00717.68
7.0.210.0040.00816.91
7.0.200.0030.01017.00
7.0.190.0060.00816.98
7.0.180.0000.01216.39
7.0.170.0060.00616.60
7.0.160.0030.01016.55
7.0.150.0030.00916.38
7.0.140.0030.00916.39
7.0.130.0060.00616.67
7.0.120.0100.00316.84
7.0.110.0000.01116.64
7.0.100.0060.00616.43
7.0.90.0060.00616.51
7.0.80.0110.00716.64
7.0.70.0040.01116.61
7.0.60.0030.00916.43
7.0.50.0000.01116.46
7.0.40.0000.01416.66
7.0.30.0070.00716.65
7.0.20.0060.01016.52
7.0.10.0070.00716.70
7.0.00.0070.00716.45

preferences:
59.37 ms | 401 KiB | 5 Q