3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<'XML' <?xml version="1.0"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0"> <title>The name of your data feed</title> <link href="http://www.example.com" rel="alternate" type="text/html" /> <updated>2006-06-11T18:30:02Z</updated> <author> <name>Google</name> </author> <id>tag:example.com,2006-06-11:/support/products</id> <entry> <title>Red wool sweater</title> <id>1a</id> <link href="http://www.example.com/item1-info-page.html" /> <summary>Comfortable and soft, this sweater will keep you warm on those cold winter nights.</summary> <updated>2005-10-13T18:30:02Z</updated> <g:image_link>http://www.google.com/images/google_sm.gif</g:image_link> <g:price>25</g:price> <g:condition>new</g:condition> </entry> </feed> XML; $file = 'data://text/plain;base64,'.urlencode($xml); $fileSize = strlen($xml); $readBytes = 0; $reader = new XMLReader; $reader->open($file); $dom = new DOMDocument(); $xpath = new DOMXpath($dom); $xpath->registerNamespace('atom', 'http://www.w3.org/2005/Atom'); $xpath->registerNamespace('gi', 'http://base.google.com/ns/1.0'); // look for the first entry element while ($reader->read() && $reader->localName !== 'entry') { continue; } // while you have an entry element while ($reader->localName === 'entry') { $node = $dom->importNode($reader->expand(), TRUE); var_dump( [ 'title' => $xpath->evaluate('string(atom:title)', $entry), 'summary' => $xpath->evaluate('string(atom:summary)', $entry), 'image-link' => $xpath->evaluate('string(gi:image_link)', $entry) ] ); $readBytes += strlen($reader->readOuterXml()); printf( 'Read %s of %s bytes, %d%%', $readBytes, $fileSize, round($readBytes * 100 / $fileSize) ); // move to the next entry sibling $reader->next('entry'); }

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.40.0090.00619.23
8.3.30.0110.00419.09
8.3.20.0030.00518.98
8.3.10.0040.00419.20
8.3.00.0040.00419.63
8.2.170.0090.00622.96
8.2.160.0100.00719.36
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00021.25
8.2.110.0030.00720.77
8.2.100.0070.00418.16
8.2.90.0000.00819.38
8.2.80.0040.00418.00
8.2.70.0000.00917.75
8.2.60.0080.00318.17
8.2.50.0030.00618.07
8.2.40.0060.00318.59
8.2.30.0040.00418.46
8.2.20.0030.00518.07
8.2.10.0000.00718.08
8.2.00.0000.00818.13
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0080.00328.09
8.1.240.0030.00622.44
8.1.230.0090.00317.89
8.1.220.0000.00818.03
8.1.210.0050.00318.77
8.1.200.0000.00917.60
8.1.190.0080.00017.60
8.1.180.0050.00318.10
8.1.170.0000.00818.65
8.1.160.0000.00719.40
8.1.150.0040.00418.88
8.1.140.0020.00517.67
8.1.130.0040.00419.39
8.1.120.0040.00417.80
8.1.110.0040.00417.72
8.1.100.0020.00517.73
8.1.90.0040.00417.73
8.1.80.0020.00517.70
8.1.70.0050.00317.56
8.1.60.0040.00417.74
8.1.50.0000.00817.86
8.1.40.0030.00517.86
8.1.30.0000.00917.96
8.1.20.0040.00418.05
8.1.10.0030.00617.97
8.1.00.0060.00317.70
8.0.300.0000.00718.77
8.0.290.0000.00717.00
8.0.280.0030.00318.70
8.0.270.0050.00218.29
8.0.260.0030.00317.14
8.0.250.0080.00317.20
8.0.240.0040.00417.30
8.0.230.0030.00317.29
8.0.220.0040.00317.39
8.0.210.0000.00717.30
8.0.200.0030.00317.12
8.0.190.0030.00417.20
8.0.180.0000.00817.41
8.0.170.0050.00317.38
8.0.160.0000.00817.18
8.0.150.0080.00017.30
8.0.140.0050.00517.09
8.0.130.0030.00313.73
8.0.120.0030.00617.20
8.0.110.0000.00717.01
8.0.100.0040.00417.24
8.0.90.0070.00017.17
8.0.80.0090.00617.14
8.0.70.0080.00017.07
8.0.60.0000.00917.24
8.0.50.0080.00017.09
8.0.30.0090.01317.21
8.0.20.0100.01017.41
8.0.10.0060.00317.22
8.0.00.0090.00917.12
7.4.330.0000.00513.21
7.4.320.0000.00616.84
7.4.300.0000.00616.96
7.4.290.0030.00316.74
7.4.280.0040.00416.89
7.4.270.0000.00716.96
7.4.260.0030.00313.57
7.4.250.0050.00316.70
7.4.240.0030.00516.66
7.4.230.0050.00216.89
7.4.220.0070.01016.84
7.4.210.0030.01316.89
7.4.200.0000.00716.96
7.4.190.0060.00217.08
7.4.160.0160.00016.73
7.4.150.0170.00916.79
7.4.140.0200.00617.86
7.4.130.0100.01016.79
7.4.120.0120.00616.82
7.4.110.0100.01016.75
7.4.100.0060.01016.76
7.4.90.0170.00716.68
7.4.80.0170.00719.39
7.4.70.0030.01716.86
7.4.60.0080.00816.82
7.4.50.0030.00616.85
7.4.40.0090.00616.71
7.4.30.0090.00616.78
7.4.00.0000.01615.27
7.3.330.0060.00013.45
7.3.320.0030.00313.49
7.3.310.0000.00716.49
7.3.300.0030.00316.72
7.3.290.0060.00916.59
7.3.280.0040.01116.51
7.3.270.0070.01116.64
7.3.260.0030.01616.60
7.3.240.0070.01016.64
7.3.230.0120.01216.75
7.3.210.0030.01316.79
7.3.200.0060.01216.59
7.3.190.0060.00916.83
7.3.180.0040.01516.84
7.3.170.0070.01016.53
7.3.160.0090.00916.83
7.3.120.0080.00815.28
7.2.330.0070.01117.16
7.2.320.0100.01016.88
7.2.310.0040.01316.96
7.2.300.0130.00317.00
7.2.290.0120.00617.17
7.2.60.0780.01015.39
7.2.00.0000.01719.66
7.1.200.0080.00616.08
7.1.100.0060.00618.29
7.1.70.0000.00717.12
7.1.60.0110.01419.25
7.1.50.0070.00417.26
7.1.00.0070.03022.61
7.0.200.0040.00417.20
7.0.140.0100.06722.43
7.0.120.0100.06722.31
7.0.60.0070.08720.02
7.0.50.0100.08018.22
7.0.40.0270.03318.04
7.0.30.0100.04318.01
7.0.20.0070.06718.13
7.0.10.0130.04017.95
7.0.00.0170.07318.07
5.6.280.0030.07321.29
5.6.210.0070.04321.05
5.6.200.0000.08718.47
5.6.190.0130.08018.38
5.6.180.0030.04318.55
5.6.170.0030.07018.43
5.6.160.0000.05318.44
5.6.150.0070.08318.44
5.6.140.0070.07318.48
5.6.130.0070.08318.44
5.6.120.0030.07018.40
5.6.110.0030.04718.36
5.6.100.0130.08318.35
5.6.90.0030.08018.41
5.6.80.0000.08017.75
5.6.70.0100.08017.75
5.6.60.0200.05317.78
5.6.50.0000.08717.80
5.6.40.0100.07317.86
5.6.30.0030.06717.82
5.6.20.0030.04317.81
5.6.10.0130.05317.79
5.6.00.0100.06317.82
5.5.350.0230.07020.73
5.5.340.0100.05718.21
5.5.330.0030.04718.27
5.5.320.0000.04318.21
5.5.310.0130.05018.30
5.5.300.0100.05318.21
5.5.290.0000.06318.35
5.5.280.0070.08718.16
5.5.270.0000.04718.26
5.5.260.0070.08318.26
5.5.250.0100.04018.17
5.5.240.0130.07017.59
5.5.230.0130.07017.55
5.5.220.0030.08317.69
5.5.210.0100.06717.55
5.5.200.0130.05017.62
5.5.190.0070.08017.59
5.5.180.0030.08017.56
5.5.160.0130.06717.50
5.5.150.0200.04317.59
5.5.140.0070.04017.59
5.5.130.0070.07317.54
5.5.120.0070.04017.62
5.5.110.0070.08017.52
5.5.100.0170.05017.50
5.5.90.0100.07017.60
5.5.80.0130.04717.46
5.5.70.0070.03717.45
5.5.60.0000.06717.41
5.5.50.0070.05017.50
5.5.40.0030.04717.59
5.5.30.0200.05017.44
5.5.20.0130.07317.48
5.5.10.0100.07317.44
5.5.00.0070.05717.47
5.4.450.0170.07019.59
5.4.440.0100.06019.73
5.4.430.0200.05719.70
5.4.420.0000.04719.70
5.4.410.0000.08319.42
5.4.400.0030.08019.21
5.4.390.0030.04719.25
5.4.380.0030.07319.25
5.4.370.0030.07719.37
5.4.360.0130.06319.38
5.4.350.0100.07019.17
5.4.340.0100.05319.35
5.4.320.0070.06019.25
5.4.310.0070.04319.17
5.4.300.0170.06319.37
5.4.290.0030.05019.38
5.4.280.0030.06719.30
5.4.270.0070.07719.38
5.4.260.0030.07319.17
5.4.250.0030.04019.37
5.4.240.0100.06319.38
5.4.230.0030.04019.40
5.4.220.0070.03719.25
5.4.210.0070.07019.40
5.4.200.0100.04019.24
5.4.190.0130.07019.40
5.4.180.0030.06719.19
5.4.170.0070.07719.32
5.4.160.0030.04019.36
5.4.150.0100.04019.27
5.4.140.0170.06016.69
5.4.130.0070.07716.64
5.4.120.0070.07716.61
5.4.110.0030.08316.83
5.4.100.0070.06016.83
5.4.90.0030.05316.63
5.4.80.0070.05716.61
5.4.70.0100.07316.76
5.4.60.0070.05316.67
5.4.50.0070.07016.64
5.4.40.0030.03716.59
5.4.30.0100.05716.71
5.4.20.0030.03716.53
5.4.10.0030.07716.54
5.4.00.0030.04316.04
5.3.290.0130.07314.50
5.3.280.0030.03714.43
5.3.270.0230.04714.53
5.3.260.0100.04314.69
5.3.250.0070.07014.57
5.3.240.0030.08014.58
5.3.230.0030.07314.57
5.3.220.0130.06714.59
5.3.210.0100.07314.51
5.3.200.0070.04714.51
5.3.190.0070.07314.50
5.3.180.0030.07314.43
5.3.170.0100.06014.50
5.3.160.0130.07314.52
5.3.150.0070.06714.53
5.3.140.0030.07714.53
5.3.130.0070.07314.51
5.3.120.0070.07714.52
5.3.110.0030.07714.38
5.3.100.0100.03714.02
5.3.90.0000.04713.96
5.3.80.0000.04013.98
5.3.70.0030.04713.93
5.3.60.0100.07013.95
5.3.50.0100.06713.75
5.3.40.0030.07313.88
5.3.30.0030.07313.89
5.3.20.0070.04313.67
5.3.10.0070.07713.63
5.3.00.0100.07013.55
5.2.170.0070.05011.14
5.2.160.0030.05011.13
5.2.150.0000.04010.93
5.2.140.0070.05711.05
5.2.130.0070.06011.11
5.2.120.0170.05311.04
5.2.110.0070.05010.88
5.2.100.0070.06310.95
5.2.90.0000.06711.09
5.2.80.0130.05311.12
5.2.70.0030.06711.05
5.2.60.0070.05011.00
5.2.50.0070.06310.84
5.2.40.0100.03310.92
5.2.30.0030.06010.95
5.2.20.0030.06010.86
5.2.10.0070.04310.70
5.2.00.0030.05010.70
5.1.60.0030.03710.02
5.1.50.0100.04710.03
5.1.40.0030.0539.95
5.1.30.0070.03710.48
5.1.20.0000.04310.31
5.1.10.0100.05010.11
5.1.00.0030.05710.14
5.0.50.0070.0438.59
5.0.40.0030.0408.34
5.0.30.0030.0338.20
5.0.20.0030.0438.23
5.0.10.0100.0408.15
5.0.00.0030.0608.18
4.4.90.0030.0337.72
4.4.80.0030.0337.72
4.4.70.0100.0307.72
4.4.60.0030.0277.72
4.4.50.0030.0337.72
4.4.40.0030.0507.72
4.4.30.0030.0277.72
4.4.20.0000.0237.72
4.4.10.0030.0377.72
4.4.00.0000.0537.72
4.3.110.0030.0177.72
4.3.100.0000.0177.72
4.3.90.0030.0337.72
4.3.80.0000.0577.72
4.3.70.0000.0307.72
4.3.60.0000.0377.72
4.3.50.0030.0277.72
4.3.40.0000.0507.72
4.3.30.0000.0237.72
4.3.20.0030.0237.72
4.3.10.0000.0207.72
4.3.00.0000.0377.72

preferences:
65.63 ms | 400 KiB | 5 Q