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.0090.00916.98
8.3.50.0070.01022.07
8.3.40.0040.01119.08
8.3.30.0070.00719.29
8.3.20.0040.00420.41
8.3.10.0040.00423.72
8.3.00.0100.00019.63
8.2.180.0070.01118.63
8.2.170.0090.00622.96
8.2.160.0110.00320.68
8.2.150.0030.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00422.54
8.2.110.0100.00722.52
8.2.100.0040.00818.16
8.2.90.0050.00319.30
8.2.80.0000.00818.00
8.2.70.0080.00317.88
8.2.60.0080.00018.29
8.2.50.0030.00618.07
8.2.40.0040.00420.13
8.2.30.0040.00420.14
8.2.20.0000.00818.02
8.2.10.0030.00520.18
8.2.00.0050.00318.07
8.1.280.0120.00325.92
8.1.270.0100.00024.05
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0090.00024.13
8.1.230.0080.00419.66
8.1.220.0000.00918.05
8.1.210.0040.00418.77
8.1.200.0030.00717.50
8.1.190.0040.00417.50
8.1.180.0030.00618.10
8.1.170.0000.00819.06
8.1.160.0040.00422.15
8.1.150.0040.00418.88
8.1.140.0040.00417.81
8.1.130.0000.00718.18
8.1.120.0000.00817.62
8.1.110.0080.00017.60
8.1.100.0000.00817.77
8.1.90.0040.00417.63
8.1.80.0000.00717.86
8.1.70.0050.00317.81
8.1.60.0030.00617.74
8.1.50.0050.00317.74
8.1.40.0030.00618.01
8.1.30.0000.00917.85
8.1.20.0040.00418.11
8.1.10.0040.00418.03
8.1.00.0050.00317.82
8.0.300.0040.00419.39
8.0.290.0000.00717.53
8.0.280.0030.00318.71
8.0.270.0000.00717.55
8.0.260.0000.00617.60
8.0.250.0000.00717.16
8.0.240.0090.00017.13
8.0.230.0040.00417.10
8.0.220.0000.00717.32
8.0.210.0070.00017.23
8.0.200.0000.00617.32
8.0.190.0090.00017.17
8.0.180.0050.00317.28
8.0.170.0000.01017.38
8.0.160.0030.00517.30
8.0.150.0040.00417.27
8.0.140.0040.00417.23
8.0.130.0000.00713.58
8.0.120.0030.00617.20
8.0.110.0000.00717.09
8.0.100.0080.00017.25
8.0.90.0040.00417.13
8.0.80.0060.01017.20
8.0.70.0050.00217.11
8.0.60.0000.00817.32
8.0.50.0050.00317.09
8.0.30.0100.01117.41
8.0.20.0110.00717.40
8.0.10.0080.00017.29
8.0.00.0100.01217.08
7.4.330.0050.00015.46
7.4.320.0000.00616.60
7.4.300.0030.00316.74
7.4.290.0030.00316.93
7.4.280.0040.00417.02
7.4.270.0000.00816.86
7.4.260.0070.00016.64
7.4.250.0050.00316.91
7.4.240.0020.00516.79
7.4.230.0000.00716.86
7.4.220.0090.00917.00
7.4.210.0080.00716.96
7.4.200.0040.00416.73
7.4.190.0000.00817.13
7.4.160.0120.01216.77
7.4.150.0060.01217.40
7.4.140.0060.01217.86
7.4.130.0090.00816.84
7.4.120.0090.01116.87
7.4.110.0090.01516.86
7.4.100.0090.01416.97
7.4.90.0240.01416.86
7.4.80.0100.00719.39
7.4.70.0100.00616.85
7.4.60.0040.01216.69
7.4.50.0090.00016.58
7.4.40.0140.00316.85
7.4.30.0050.01116.81
7.3.330.0030.00313.48
7.3.320.0030.00313.40
7.3.310.0030.00316.66
7.3.300.0040.00416.73
7.3.290.0120.00816.54
7.3.280.0100.00616.63
7.3.270.0100.00717.40
7.3.260.0120.00616.62
7.3.250.0100.00716.94
7.3.240.0090.00816.71
7.3.230.0030.01516.65
7.3.210.0060.01216.73
7.3.200.0140.00719.39
7.3.190.0070.01416.76
7.3.180.0130.00316.63
7.3.170.0030.01316.74
7.3.160.0030.01716.77
7.2.330.0140.00316.45
7.2.320.0150.00816.22
7.2.310.0130.00316.14
7.2.300.0070.01016.40
7.2.290.0180.00016.31
5.4.290.0140.05412.45
5.4.280.0100.04812.34
5.4.270.0100.04312.35
5.4.260.0080.03912.35
5.4.250.0070.03912.34
5.4.240.0070.04112.35
5.4.230.0090.03612.34
5.4.220.0060.03812.34
5.4.210.0090.03312.34
5.4.200.0050.04012.34
5.4.190.0140.03912.34
5.4.180.0080.04512.34
5.4.170.0090.04212.34
5.4.160.0080.04012.34
5.4.150.0100.04112.34
5.4.140.0130.05212.02
5.4.130.0110.04012.01
5.4.120.0080.03411.97
5.4.110.0050.04111.96
5.4.100.0090.03311.96
5.4.90.0080.04011.96
5.4.80.0060.03911.97
5.4.70.0080.04011.96
5.4.60.0130.05811.96
5.4.50.0060.03611.96
5.4.40.0110.04211.95
5.4.30.0090.04511.95
5.4.20.0150.06011.94
5.4.10.0100.06011.95
5.4.00.0060.05911.44
5.3.280.0100.05712.71
5.3.270.0130.06812.72
5.3.260.0160.06812.72
5.3.250.0080.05512.72
5.3.240.0140.06112.72
5.3.230.0110.03812.71
5.3.220.0090.04912.68
5.3.210.0080.05812.68
5.3.200.0140.05312.68
5.3.190.0130.05912.68
5.3.180.0090.05812.67
5.3.170.0090.06112.67
5.3.160.0110.05212.67
5.3.150.0070.04812.67
5.3.140.0090.05012.66
5.3.130.0080.03712.65
5.3.120.0070.04112.66
5.3.110.0090.03712.66
5.3.100.0060.03712.12
5.3.90.0060.04912.08
5.3.80.0090.05312.07
5.3.70.0140.05312.07
5.3.60.0080.04512.06
5.3.50.0080.05012.00
5.3.40.0090.05112.00
5.3.30.0090.03711.95
5.3.20.0150.03611.73
5.3.10.0170.05811.70
5.3.00.0100.06611.68

preferences:
53.49 ms | 401 KiB | 5 Q