3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
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