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,'.base64encode($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.60.0060.01418.52
8.3.50.0130.00817.54
8.3.40.0160.00018.76
8.3.30.0140.00018.66
8.3.20.0040.00418.65
8.3.10.0060.00318.94
8.3.00.0080.00019.38
8.2.180.0150.00717.00
8.2.170.0060.01022.96
8.2.160.0090.00619.01
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00826.16
8.2.120.0050.00220.97
8.2.110.0060.00321.06
8.2.100.0080.00419.64
8.2.90.0030.00517.75
8.2.80.0050.00318.83
8.2.70.0030.00617.80
8.2.60.0060.00318.03
8.2.50.0090.00018.10
8.2.40.0050.00319.11
8.2.30.0000.00819.26
8.2.20.0030.00617.64
8.2.10.0040.00417.76
8.2.00.0000.00717.65
8.1.270.0050.00323.99
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00519.22
8.1.230.0050.00517.77
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.23
8.1.190.0060.00317.55
8.1.180.0000.00818.10
8.1.170.0040.00418.64
8.1.160.0000.00718.95
8.1.150.0000.00718.60
8.1.140.0090.00017.34
8.1.130.0040.00419.13
8.1.120.0040.00417.48
8.1.110.0000.00717.45
8.1.100.0040.00417.48
8.1.90.0050.00217.43
8.1.80.0040.00417.48
8.1.70.0070.00017.44
8.1.60.0040.00417.55
8.1.50.0040.00417.49
8.1.40.0050.00317.59
8.1.30.0000.00917.57
8.1.20.0080.00017.58
8.1.10.0030.00617.56
8.1.00.0000.00717.55
8.0.300.0070.00019.87
8.0.290.0050.00316.88
8.0.280.0040.00418.41
8.0.270.0000.00817.23
8.0.260.0000.00716.85
8.0.250.0070.00316.88
8.0.240.0070.00016.90
8.0.230.0000.00916.95
8.0.220.0040.00416.92
8.0.210.0030.00516.80
8.0.200.0060.00316.96
8.0.190.0040.00416.88
8.0.180.0020.00516.84
8.0.170.0040.00416.91
8.0.160.0050.00216.81
8.0.150.0000.00816.85
8.0.140.0060.00316.88
8.0.130.0000.00513.39
8.0.120.0040.00416.94
8.0.110.0040.00416.94
8.0.100.0040.00416.86
8.0.90.0040.00416.86
8.0.80.0130.00316.92
8.0.70.0000.00716.81
8.0.60.0080.00016.79
8.0.50.0050.00316.88
8.0.30.0060.01017.23
8.0.20.0120.01117.12
8.0.10.0040.00416.91
8.0.00.0100.01016.59
7.4.330.0000.00513.02
7.4.320.0030.00316.48
7.4.300.0030.00316.48
7.4.290.0030.00616.63
7.4.280.0040.00416.50
7.4.270.0040.00416.54
7.4.260.0050.00013.32
7.4.250.0050.00316.52
7.4.240.0030.00316.57
7.4.230.0040.00416.71
7.4.220.0040.01416.55
7.4.210.0040.01116.72
7.4.200.0070.00016.38
7.4.190.0060.00316.79
7.4.160.0060.01016.52
7.4.150.0120.00616.41
7.4.140.0090.00917.86
7.4.130.0070.01116.54
7.4.120.0100.00716.39
7.4.110.0130.01016.50
7.4.100.0090.00916.46
7.4.90.0140.00416.54
7.4.80.0030.01319.39
7.4.70.0090.01016.61
7.4.60.0130.00316.47
7.4.50.0040.00416.48
7.4.40.0030.01116.58
7.4.30.0130.00916.68
7.4.00.0090.00614.80
7.3.330.0000.00713.03
7.3.320.0050.00013.11
7.3.310.0070.00016.13
7.3.300.0000.00716.20
7.3.290.0060.01016.30
7.3.280.0070.00716.25
7.3.270.0080.01116.42
7.3.260.0110.00616.46
7.3.240.0110.00616.27
7.3.230.0100.00716.24
7.3.210.0070.01316.49
7.3.200.0140.00416.44
7.3.190.0070.01116.25
7.3.180.0030.01316.53
7.3.170.0060.01216.60
7.3.160.0120.00316.26
7.3.120.0030.00714.80
7.2.330.0140.00316.56
7.2.320.0090.00916.73
7.2.310.0100.00616.50
7.2.300.0160.00916.66
7.2.290.0070.01116.64
7.2.60.0770.00714.73
7.2.00.0040.01119.42
7.1.200.0070.00715.57
7.1.100.0030.00917.64
7.1.70.0000.01617.09
7.1.60.0080.00819.25
7.1.50.0140.00716.62
7.1.00.0130.06722.30
7.0.200.0000.00916.46
7.0.140.0030.07021.98
7.0.120.0000.07722.00
7.0.60.0030.05719.96
7.0.50.0070.03717.85
7.0.40.0070.09020.23
7.0.30.0600.05720.13
7.0.20.0270.07320.02
7.0.10.0000.07720.09
7.0.00.0070.08720.16
5.6.280.0030.07321.14
5.6.210.0130.05720.70
5.6.200.0170.07018.11
5.6.190.0030.04320.35
5.6.180.4130.04020.48
5.6.170.0300.08320.71
5.6.160.0170.06720.52
5.6.150.0070.08318.18
5.6.140.0030.08018.17
5.6.130.0030.06318.22
5.6.120.0030.06721.13
5.6.110.0270.03321.03
5.6.100.0170.07320.99
5.6.90.0000.04321.04
5.6.80.0030.09020.36
5.6.70.4700.03720.51
5.5.350.0130.08020.47
5.5.340.0070.08317.87
5.5.330.0030.09020.41
5.5.320.0270.04720.17
5.5.310.0300.05720.18
5.5.300.0130.07718.01
5.5.290.0030.08017.97
5.5.280.0070.08720.86
5.5.270.0070.06320.85
5.5.260.0130.07320.65
5.5.250.0030.09020.59
5.5.240.0000.09020.13
5.4.450.0700.03719.38
5.4.440.0500.04319.09
5.4.430.0770.03719.48
5.4.420.0630.03719.36
5.4.410.0400.03319.26
5.4.400.0800.03718.91
5.4.390.0900.05019.06
5.4.380.0500.03319.07
5.4.370.0530.04018.90
5.4.360.0500.04319.07
5.4.350.0770.03718.90
5.4.340.0430.04019.04
5.4.320.0730.04718.93
5.4.310.0700.04319.07
5.4.300.0530.05318.77
5.4.290.0630.03719.06
5.4.280.1030.03019.05
5.4.270.1100.03719.06
5.4.260.0670.06019.13
5.4.250.0730.03318.79
5.4.240.0530.05318.88
5.4.230.0370.04019.05
5.4.220.0030.03719.05
5.4.210.0670.04019.09
5.4.200.0200.03719.21
5.4.190.0730.06318.79
5.4.180.0300.05319.15
5.4.170.0570.04018.79
5.4.160.0700.03718.91
5.4.150.0700.03719.11
5.4.140.0430.05016.20
5.4.130.0600.04316.36
5.4.120.0570.03716.27
5.4.110.0230.04016.35
5.4.100.0500.04016.07
5.4.90.0600.03316.07
5.4.80.0530.04316.05
5.4.70.0670.05016.26
5.4.60.0700.02316.16
5.4.50.0430.03716.42
5.4.40.0670.03016.25
5.4.30.0300.04316.20
5.4.20.0700.04016.25
5.4.10.0770.03016.35
5.4.00.0400.04715.77
5.3.290.0500.04015.77
5.3.280.0530.04315.77
5.3.270.0800.04015.77
5.3.260.0530.03315.77
5.3.250.0770.03715.77
5.3.240.0730.03715.77
5.3.230.0770.04315.77
5.3.220.0630.03715.77
5.3.210.0870.04715.77
5.3.200.0370.03315.77
5.3.190.0400.05315.77
5.3.180.0570.04715.77
5.3.170.0700.03015.77
5.3.160.0700.03015.77
5.3.150.0930.03015.77
5.3.140.1030.01715.77
5.3.130.0330.05315.77
5.3.120.0770.04015.77
5.3.110.0700.04315.77
5.3.100.0470.03315.77
5.3.90.0800.04715.77
5.3.80.0270.04315.77
5.3.70.0530.03015.77
5.3.60.0670.03315.77
5.3.50.0700.03315.77
5.3.40.0430.03315.77
5.3.30.0530.03715.77
5.3.20.0370.03015.77
5.3.10.0570.03015.77
5.3.00.0570.03715.77
5.2.170.0200.03015.77
5.2.160.0330.03015.77
5.2.150.0530.02715.77
5.2.140.0330.03315.77
5.2.130.0270.03715.77
5.2.120.0670.03015.77
5.2.110.0370.03015.77
5.2.100.0600.03315.77
5.2.90.0430.03315.77
5.2.80.0800.02315.77
5.2.70.0730.02715.77
5.2.60.0600.03315.77
5.2.50.0770.02315.77
5.2.40.0470.02315.77
5.2.30.0130.03315.77
5.2.20.0400.03315.77
5.2.10.0700.02715.77
5.2.00.0500.02315.77
5.1.60.0530.02015.77
5.1.50.0230.03315.77
5.1.40.0300.03015.77
5.1.30.0330.02315.77
5.1.20.0400.02315.77
5.1.10.0100.02315.77
5.1.00.0230.03015.77
5.0.50.0070.02315.77
5.0.40.0300.01315.77
5.0.30.0130.04315.77
5.0.20.0100.02015.77
5.0.10.0100.02315.77
5.0.00.0270.02315.77
4.4.90.0070.01715.77
4.4.80.0230.02015.77
4.4.70.0070.01715.77
4.4.60.0300.01715.77
4.4.50.0170.02015.77
4.4.40.0100.02315.77
4.4.30.0270.01015.77
4.4.20.0270.01715.77
4.4.10.0230.01715.77
4.4.00.0100.02715.77
4.3.110.0170.02015.77
4.3.100.0170.02015.77
4.3.90.0330.01015.77
4.3.80.0230.02315.77
4.3.70.0230.01315.77
4.3.60.0200.01315.77
4.3.50.0270.01015.77
4.3.40.0330.02015.77
4.3.30.0230.01315.77
4.3.20.0100.01715.77
4.3.10.0030.01315.77
4.3.00.0000.01715.77

preferences:
57.7 ms | 400 KiB | 5 Q