3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<'XML' <a> <b> <c>text</c> <c>stuff</c> </b> <d> <c>code</c> </d> </a> XML; // load source XML and create Xpath instance $source = new DOMDocument(); $source->loadxml($string); $xpath = new DOMXpath($source); // create target document with document element $target = new DOMDocument(); $root = $target->appendChild($dom->createElement('d')); // copy nodes from source to target foreach ($xpath->evaluate('/a/b/c') as $child) { $root->appendChild($target->importNode($child)); } // output target echo $target->saveXml();

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.0110.00716.88
8.3.50.0080.01122.03
8.3.40.0110.00419.22
8.3.30.0040.01419.34
8.3.20.0000.00820.71
8.3.10.0080.00023.76
8.3.00.0050.00319.75
8.2.180.0090.00616.88
8.2.170.0110.00422.96
8.2.160.0100.00320.66
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00926.16
8.2.120.0050.00322.71
8.2.110.0070.00322.50
8.2.100.0120.00018.16
8.2.90.0060.00319.28
8.2.80.0050.00317.97
8.2.70.0030.00717.71
8.2.60.0060.00318.18
8.2.50.0000.01018.07
8.2.40.0040.00420.20
8.2.30.0000.00819.95
8.2.20.0050.00318.00
8.2.10.0040.00418.43
8.2.00.0000.00817.97
8.1.280.0090.01225.92
8.1.270.0060.00924.09
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0050.00524.10
8.1.230.0060.00619.49
8.1.220.0060.00317.91
8.1.210.0090.00018.77
8.1.200.0060.00317.61
8.1.190.0040.00417.60
8.1.180.0040.00418.10
8.1.170.0050.00318.96
8.1.160.0070.00022.32
8.1.150.0040.00418.89
8.1.140.0060.00317.71
8.1.130.0070.00018.15
8.1.120.0000.00717.58
8.1.110.0040.00417.82
8.1.100.0040.00417.87
8.1.90.0050.00217.66
8.1.80.0030.00517.62
8.1.70.0070.00017.61
8.1.60.0030.00517.70
8.1.50.0000.00817.81
8.1.40.0000.00817.75
8.1.30.0040.00418.06
8.1.20.0030.00517.83
8.1.10.0000.00717.80
8.1.00.0000.00817.66
8.0.300.0060.00319.31
8.0.290.0030.00617.43
8.0.280.0040.00418.58
8.0.270.0000.00717.51
8.0.260.0060.00017.51
8.0.250.0030.00317.18
8.0.240.0000.00617.21
8.0.230.0040.00417.40
8.0.220.0000.00717.33
8.0.210.0030.00317.14
8.0.200.0030.00317.14
8.0.190.0030.00517.13
8.0.180.0000.00717.40
8.0.170.0070.00017.12
8.0.160.0050.00317.03
8.0.150.0040.00417.03
8.0.140.0040.00417.05
8.0.130.0090.00013.73
8.0.120.0040.00417.30
8.0.110.0040.00417.15
8.0.100.0040.00417.04
8.0.90.0000.00717.26
8.0.80.0100.00717.25
8.0.70.0050.00317.25
8.0.60.0080.00017.23
8.0.50.0070.00017.03
8.0.30.0090.00917.50
8.0.20.0130.01017.50
8.0.10.0040.00417.44
8.0.00.0110.00917.02
7.4.330.0060.00015.36
7.4.320.0000.00616.71
7.4.300.0070.00016.99
7.4.290.0000.00816.96
7.4.280.0030.00617.03
7.4.270.0070.00017.01
7.4.260.0030.00316.98
7.4.250.0000.00916.98
7.4.240.0060.00216.89
7.4.230.0000.00716.93
7.4.220.0070.01116.93
7.4.210.0070.00816.99
7.4.200.0080.00016.82
7.4.190.0080.00017.13
7.4.160.0100.01016.90
7.4.150.0130.00617.40
7.4.140.0100.01017.86
7.4.130.0080.00916.94
7.4.120.0090.00916.81
7.4.110.0100.01316.94
7.4.100.0120.00616.98
7.4.90.0070.01016.76
7.4.80.0140.00319.39
7.4.70.0060.01016.97
7.4.60.0100.00716.66
7.4.50.0060.00316.80
7.4.40.0130.00317.02
7.4.30.0060.01116.92
7.3.330.0050.00013.48
7.3.320.0000.00613.34
7.3.310.0030.00316.69
7.3.300.0000.00716.58
7.3.290.0070.00716.71
7.3.280.0080.01016.65
7.3.270.0070.01117.40
7.3.260.0200.00316.53
7.3.250.0080.01016.55
7.3.240.0160.00016.54
7.3.230.0060.01216.52
7.3.210.0070.01016.93
7.3.200.0110.01019.39
7.3.190.0060.01216.67
7.3.180.0070.01017.04
7.3.170.0090.00616.59
7.3.160.0130.00316.86
7.2.330.0030.01416.54
7.2.320.0130.00316.22
7.2.310.0060.01616.23
7.2.300.0030.01416.21
7.2.290.0080.00816.60
5.4.290.0220.06412.45
5.4.280.0080.05012.34
5.4.270.0140.06212.34
5.4.260.0180.07712.34
5.4.250.0160.06812.34
5.4.240.0130.07712.34
5.4.230.0220.06812.34
5.4.220.0140.06112.33
5.4.210.0160.05912.33
5.4.200.0130.05012.34
5.4.190.0240.08212.33
5.4.180.0160.11012.33
5.4.170.0140.07912.34
5.4.160.0160.06412.34
5.4.150.0160.06812.34
5.4.140.0200.08812.02
5.4.130.0140.05912.00
5.4.120.0130.07711.96
5.4.110.0290.06711.96
5.4.100.0230.06411.96
5.4.90.0130.06911.96
5.4.80.0140.06411.96
5.4.70.0260.08111.96
5.4.60.0090.05611.96
5.4.50.0270.08611.96
5.4.40.0100.06511.95
5.4.30.0110.06311.94
5.4.20.0120.07611.94
5.4.10.0120.05411.95
5.4.00.0080.05711.44
5.3.280.0100.05712.71
5.3.270.0110.06112.73
5.3.260.0090.06212.72
5.3.250.0100.06112.72
5.3.240.0080.06012.72
5.3.230.0100.05512.71
5.3.220.0100.05812.68
5.3.210.0090.06712.68
5.3.200.0080.05012.68
5.3.190.0110.05212.68
5.3.180.0310.08312.68
5.3.170.0090.03812.67
5.3.160.0260.05712.67
5.3.150.0120.04912.67
5.3.140.0250.09912.66
5.3.130.0110.08112.66
5.3.120.0090.04612.65
5.3.110.0130.07012.66
5.3.100.0220.10312.12
5.3.90.0140.05212.08
5.3.80.0130.06112.08
5.3.70.0180.07212.07
5.3.60.0090.05012.07
5.3.50.0090.04712.00
5.3.40.0120.08412.00
5.3.30.0330.11411.95
5.3.20.0090.05711.73
5.3.10.0040.04311.70
5.3.00.0240.11211.68

preferences:
40.4 ms | 401 KiB | 5 Q