3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="utf-8"?> <products> <item> <reference>00001</reference> <other_string>PRODUCT 1</other_string> <brand>BRAND 1</brand> <promo>YES</promo> </item> <item> <reference>00002</reference> <other_string>PRODUCT 2</other_string> <brand>BRAND 2</brand> <promo>YES</promo> </item> <item> <reference>00003</reference> <other_string>PRODUCT 3</other_string> <brand>BRAND 3</brand> <promo>NO</promo> </item> <item> <reference>00004</reference> <other_string>PRODUCT 4</other_string> <brand>BRAND 4</brand> <promo>NO</promo> </item> <item> <reference>00005</reference> <other_string>PRODUCT 5</other_string> <brand>BRAND 5</brand> <promo>YES</promo> </item> </products>'; $doc = new DOMDocument(); $doc->loadXML($xml); foreach ($doc->getElementsByTagName('promo') as $ele) { $newnode = $doc->createElement('newnode'); $newnode->nodeValue = $ele->nodeValue == 'YES' ? 1 : 0; $ele->parentNode->appendChild($newnode); } echo $doc->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.5.00.0130.00920.15
8.4.150.0020.00114.05
8.4.140.0130.01217.72
8.4.130.0140.00618.04
8.4.120.0110.00822.86
8.4.110.0020.00719.11
8.4.100.0100.00318.08
8.4.90.0120.00818.06
8.4.80.0100.01118.31
8.4.70.0050.00417.99
8.4.60.0170.00519.06
8.4.50.0080.01317.97
8.4.40.0100.01019.66
8.4.30.0120.00819.71
8.4.20.0060.01319.14
8.4.10.0040.00419.61
8.3.280.0110.00918.79
8.3.270.0140.00617.15
8.3.260.0080.01016.79
8.3.250.0060.00320.86
8.3.240.0140.00618.73
8.3.230.0120.00716.77
8.3.220.0120.00616.90
8.3.210.0070.01016.91
8.3.200.0150.00517.03
8.3.190.0070.00117.73
8.3.180.0120.00717.47
8.3.170.0110.00417.22
8.3.160.0090.00916.99
8.3.150.0110.00717.54
8.3.140.0080.00017.08
8.3.130.0080.00018.79
8.3.120.0040.00421.26
8.3.110.0030.00720.94
8.3.100.0060.01024.06
8.3.90.0080.00016.95
8.3.80.0000.01317.00
8.3.70.0090.01218.68
8.3.60.0040.01518.68
8.3.50.0110.00416.66
8.3.40.0060.01018.97
8.3.30.0110.00419.14
8.3.20.0080.00020.79
8.3.10.0060.00323.96
8.3.00.0040.00422.75
8.2.290.0050.00619.08
8.2.280.0040.00522.35
8.2.270.0030.00717.07
8.2.260.0080.00819.08
8.2.250.0030.00618.70
8.2.240.0040.00419.15
8.2.230.0080.00022.58
8.2.220.0030.00637.54
8.2.210.0040.00426.77
8.2.200.0090.00017.00
8.2.190.0070.01016.88
8.2.180.0160.00718.54
8.2.170.0070.01422.96
8.2.160.0030.01022.49
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00021.21
8.2.110.0030.00621.39
8.2.100.0040.00718.41
8.2.90.0000.00819.42
8.2.80.0040.00417.97
8.2.70.0070.00717.88
8.2.60.0050.00518.05
8.2.50.0000.00818.10
8.2.40.0040.00420.72
8.2.30.0000.00718.28
8.2.20.0030.00518.36
8.2.10.0040.00419.69
8.2.00.0040.00418.39
8.1.330.0120.00716.62
8.1.320.0080.01116.33
8.1.310.0070.01116.84
8.1.300.0000.00916.61
8.1.290.0090.00030.84
8.1.280.0140.00025.92
8.1.270.0090.00020.70
8.1.260.0040.00426.35
8.1.250.0090.00628.09
8.1.240.0070.00419.38
8.1.230.0040.00718.01
8.1.220.0050.00318.03
8.1.210.0040.00418.77
8.1.200.0030.00617.73
8.1.190.0050.00317.60
8.1.180.0000.00918.10
8.1.170.0070.00418.86
8.1.160.0040.00422.49
8.1.150.0000.00718.93
8.1.140.0070.00020.48
8.1.130.0030.00320.55
8.1.120.0030.00317.81
8.1.110.0030.00617.75
8.1.100.0060.00317.64
8.1.90.0020.00517.64
8.1.80.0040.00417.80
8.1.70.0040.00417.72
8.1.60.0000.00817.90
8.1.50.0000.01017.77
8.1.40.0040.00417.86
8.1.30.0080.00018.04
8.1.20.0000.00917.92
8.1.10.0040.00417.81
8.1.00.0040.00417.84
8.0.300.0030.00518.77
8.0.290.0030.00617.00
8.0.280.0000.00718.63
8.0.270.0000.00717.15
8.0.260.0000.00720.42
8.0.250.0030.00317.27
8.0.240.0070.00017.25
8.0.230.0040.00417.24
8.0.220.0000.00717.12
8.0.210.0070.00017.23
8.0.200.0000.00817.18
8.0.190.0050.00317.24
8.0.180.0040.00417.24
8.0.170.0030.00617.07
8.0.160.0040.00417.10
8.0.150.0030.00517.05
8.0.140.0090.00017.13
8.0.130.0000.00613.55
8.0.120.0060.00317.06
8.0.110.0040.00417.21
8.0.100.0040.00417.13
8.0.90.0040.00417.22
8.0.80.0030.01117.13
8.0.70.0000.00717.21
8.0.60.0000.00717.02
8.0.50.0050.00317.01
8.0.30.0110.00717.37
8.0.20.0130.00617.07
8.0.10.0030.00517.22
8.0.00.0130.00717.12
7.4.330.0000.00517.12
7.4.320.0040.00416.68
7.4.300.0000.00716.78
7.4.290.0000.00716.89
7.4.280.0040.00416.87
7.4.270.0030.00616.88
7.4.260.0070.00016.83
7.4.250.0030.00316.68
7.4.240.0000.00816.74
7.4.230.0030.00316.80
7.4.220.0000.00716.91
7.4.210.0070.00716.86
7.4.200.0070.00016.82
7.4.160.0090.00616.81
7.4.140.0090.01017.86
7.4.130.0140.00316.84
7.4.120.0070.01916.66
7.4.110.0070.01016.68
7.4.100.0110.00816.91
7.4.90.0160.00616.66
7.4.80.0120.00619.39
7.4.70.0110.00616.91
7.4.60.0100.00716.73
7.4.50.0030.00616.75
7.4.40.0100.00716.80
7.4.10.0030.01515.12
7.4.00.0140.00514.97
7.3.330.0060.00013.39
7.3.320.0060.00013.36
7.3.310.0070.00016.55
7.3.300.0070.00016.52
7.3.290.0030.00316.43
7.3.280.0060.01216.49
7.3.260.0110.01216.63
7.3.240.0100.01016.56
7.3.230.0030.01416.58
7.3.210.0100.00716.57
7.3.200.0130.00316.81
7.3.190.0070.01416.79
7.3.180.0140.00316.81
7.3.170.0100.00716.61
7.3.160.0070.01016.48
7.3.130.0120.00814.88
7.3.120.0100.00814.71
7.3.110.0130.00614.94
7.3.100.0030.01014.96
7.3.90.0030.00814.88
7.3.80.0070.00614.83
7.3.70.0080.00514.90
7.3.60.0040.00814.84
7.3.50.0050.00514.80
7.3.40.0070.00914.96
7.3.30.0070.00514.81
7.3.20.0080.01116.11
7.3.10.0090.00416.13
7.3.00.0100.00516.18
7.2.330.0100.01017.14
7.2.320.0070.01416.98
7.2.310.0100.01016.78
7.2.300.0150.00616.96
7.2.290.0100.01316.80
7.2.260.0090.00915.21
7.2.250.0030.01415.31
7.2.240.0080.01115.18
7.2.230.0060.01115.34
7.2.220.0050.00815.32
7.2.210.0060.00915.23
7.2.200.0050.00715.07
7.2.190.0050.00915.19
7.2.180.0030.00815.12
7.2.170.0070.00315.22
7.2.160.0070.00715.20
7.2.150.0140.00616.50
7.2.140.0060.00916.42
7.2.130.0560.00616.47
7.2.120.0210.00716.39
7.2.110.0140.00716.38
7.2.100.0760.00516.50
7.2.90.0100.00916.35
7.2.80.0390.00816.44
7.2.70.0070.01216.53
7.2.60.0500.00816.36
7.2.50.0600.01216.46
7.2.40.0060.01116.48
7.2.30.0240.00916.43
7.2.20.0060.00816.32
7.2.10.0110.00416.52
7.2.00.0060.00816.34
7.1.330.0080.00815.93
7.1.320.0020.01115.87
7.1.310.0100.00516.00
7.1.300.0050.00715.81
7.1.290.0050.00715.96
7.1.280.0050.00716.08
7.1.270.0270.00515.17
7.1.260.1130.00515.30
7.1.250.0190.00315.29
7.1.240.0080.00815.66
7.1.230.0030.01015.90
7.1.220.0030.00615.92
7.1.210.0030.01215.67
7.1.200.0100.00715.76
7.1.190.0080.00415.92
7.1.180.0060.00316.09
7.1.170.0060.00915.80
7.1.160.0060.00915.88
7.1.150.0030.01015.83
7.1.140.0060.01215.97
7.1.130.0040.00815.80
7.1.120.0040.00715.96
7.1.110.0100.00315.77
7.1.100.0000.01315.98
7.1.90.0040.00715.89
7.1.80.0030.01215.98
7.1.70.0040.00815.95
7.1.60.0000.01315.88
7.1.50.0030.00615.86
7.1.40.0060.00315.91
7.1.30.0060.00615.99
7.1.20.0080.00415.89
7.1.10.0060.00315.99
7.1.00.0110.00415.77

preferences:
35.67 ms | 403 KiB | 5 Q