3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <cats> <cat order="first"> <name>Lucy</name> <coat>Tortoiseshell</coat> <breed>Domestic Longhair</breed> </cat> <cat order="second"> <name>Ricky</name> <coat>Gray Tabby</coat> <breed>Maine Coon mix</breed> </cat> </cats> XML; $reader = new \XMLReader(); $dom = new \DOMDocument(); $reader->open('data://text/plain,' . urlencode($xml)); while ($reader->read()) { if ($reader->nodeType === \XMLReader::ELEMENT) { if ($reader->name === 'cat') { $node = $reader->expand(); $dom->appendChild($dom->importNode($node, true)); } } } var_dump($dom);

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.0040.01516.62
8.3.50.0070.00718.58
8.3.40.0060.00919.11
8.3.30.0060.01019.05
8.3.20.0060.00324.18
8.3.10.0080.00024.66
8.3.00.0000.00826.16
8.2.180.0180.00325.92
8.2.170.0070.00719.25
8.2.160.0060.01222.96
8.2.150.0080.00025.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0050.00520.89
8.2.100.0040.00818.04
8.2.90.0050.00319.63
8.2.80.0030.00618.00
8.2.70.0080.00017.88
8.2.60.0050.00318.18
8.2.50.0030.00518.05
8.2.40.0050.00320.32
8.2.30.0060.00318.43
8.2.20.0040.00418.29
8.2.10.0000.00819.67
8.2.00.0000.00819.64
8.1.280.0040.01225.92
8.1.270.0000.00823.99
8.1.260.0090.00626.35
8.1.250.0040.00428.09
8.1.240.0050.00522.58
8.1.230.0070.00718.14
8.1.220.0050.00318.14
8.1.210.0060.00318.77
8.1.200.0090.00017.72
8.1.190.0040.00417.72
8.1.180.0080.00018.10
8.1.170.0060.00319.13
8.1.160.0060.00319.37
8.1.150.0030.00719.27
8.1.140.0070.00019.23
8.1.130.0040.00420.45
8.1.120.0040.00417.77
8.1.110.0040.00417.75
8.1.100.0040.00717.86
8.1.90.0040.00417.61
8.1.80.0100.00017.71
8.1.70.0000.00717.68
8.1.60.0030.00617.88
8.1.50.0060.00317.86
8.1.40.0090.00017.79
8.1.30.0060.00317.91
8.1.20.0060.00317.93
8.1.10.0030.00717.85
8.1.00.0080.00817.71
8.0.300.0090.00018.77
8.0.290.0000.00917.13
8.0.280.0030.00318.86
8.0.270.0000.00718.37
8.0.260.0000.00618.85
8.0.250.0040.00417.24
8.0.240.0000.00717.22
8.0.230.0040.00317.23
8.0.220.0070.00017.33
8.0.210.0040.00417.20
8.0.200.0030.00317.42
8.0.190.0000.01117.46
8.0.180.0000.00717.47
8.0.170.0060.00317.38
8.0.160.0030.00617.22
8.0.150.0000.00817.19
8.0.140.0000.00717.21
8.0.130.0000.00613.84
8.0.120.0050.00517.32
8.0.110.0040.00417.29
8.0.100.0000.00917.37
8.0.90.0040.00417.13
8.0.80.0080.00817.21
8.0.70.0060.01017.27
8.0.60.0080.00817.13
8.0.50.0090.00717.22
8.0.30.0120.00817.13
8.0.20.0120.00617.35
8.0.10.0070.01017.31
8.0.00.0090.00817.32
7.4.330.0060.00015.55
7.4.320.0030.00316.91
7.4.300.0070.00016.78
7.4.290.0040.00416.95
7.4.280.0080.00417.01
7.4.270.0060.00316.74
7.4.260.0050.00013.78
7.4.250.0040.00416.79
7.4.240.0030.00516.91
7.4.230.0030.00516.89
7.4.220.0040.00416.87
7.4.210.0090.00917.04
7.4.200.0070.00716.85
7.4.190.0080.01016.95
7.4.180.0070.00917.00
7.4.160.0080.01216.89
7.4.150.0060.01216.97
7.4.140.0070.00916.74
7.4.130.0080.01116.84
7.4.120.0050.01116.84
7.4.110.0070.01116.92
7.4.100.0160.00416.87
7.4.90.0070.01016.87
7.4.80.0000.01716.86
7.4.70.0040.01016.72
7.4.60.0050.01316.87
7.4.50.0090.01216.79
7.4.40.0080.01116.74
7.4.30.0080.01116.74
7.4.20.0030.01416.80
7.4.10.0080.00716.90
7.4.00.0100.00616.72
7.3.330.0070.00016.60
7.3.320.0000.00613.48
7.3.310.0000.00716.51
7.3.300.0040.00416.69
7.3.290.0050.01016.62
7.3.280.0090.00616.63
7.3.270.0090.01016.65
7.3.260.0110.00316.55
7.3.250.0080.00716.66
7.3.240.0100.00916.62
7.3.230.0070.01216.53
7.3.220.0090.00916.54
7.3.210.0110.00716.54
7.3.200.0120.00716.48
7.3.190.0110.00616.53
7.3.180.0100.01116.58
7.3.170.0070.00716.56
7.3.160.0090.00616.49
7.3.150.0060.01016.60
7.3.140.0050.01216.57
7.3.130.0110.00816.47
7.3.120.0070.00716.56
7.3.110.0090.00516.48
7.3.100.0060.01116.37
7.3.90.0070.00716.89
7.3.80.0100.00716.52
7.3.70.0090.00616.53
7.3.60.0070.00916.75
7.3.50.0070.01016.61
7.3.40.0100.01016.70
7.3.30.0040.01216.61
7.3.20.0060.01316.72
7.3.10.0040.01316.58
7.3.00.0090.00916.53

preferences:
31.34 ms | 400 KiB | 5 Q