3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$xml = simplexml_load_file('data.xml'); $xml = simplexml_load_string('<items> <item> <images> <image>A</image> <image>B</image> <image>C</image> </images> </item> </items>'); //var_dump($xml); // Loop over items in original xml for($i = 0; $i < $xml->item->count(); $i++) { //$images; if( (count($xml->item[$i]->images->image)) > 1) { $images = clone $xml->item[$i]->images; //var_dump($images); // Remove entry unset($xml->item[$i]->images); $xml->item[$i]->addChild('images'); for($y = 0; $y < $images->image->count(); $y++) { if($y == 0) { $xml->item[$i]->images->addChild('image', $images->image[$y]); }else { $xml->item[$i]->images->addChild('image' . $y, $images->image[$y]); } } //var_dump($images); } } //$xml->asXML('POTO.xml'); echo $xml->asXML();

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.0140.00718.93
8.3.50.0120.00721.34
8.3.40.0040.01119.04
8.3.30.0110.00420.60
8.3.20.0050.00220.27
8.3.10.0040.01122.34
8.3.00.0040.00422.45
8.2.180.0070.01316.88
8.2.170.0140.00422.96
8.2.160.0070.01020.60
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0070.00021.25
8.2.110.0070.01119.42
8.2.100.0080.00419.59
8.2.90.0040.00419.47
8.2.80.0000.00719.56
8.2.70.0040.00417.73
8.2.60.0080.00018.18
8.2.50.0030.00718.07
8.2.40.0040.00818.47
8.2.30.0100.00018.38
8.2.20.0060.00318.00
8.2.10.0000.00718.03
8.2.00.0030.00617.94
8.1.280.0090.01225.92
8.1.270.0140.00424.66
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0090.00023.13
8.1.230.0110.00019.39
8.1.220.0080.00018.03
8.1.210.0060.00618.77
8.1.200.0030.00617.50
8.1.190.0030.00617.66
8.1.180.0040.00420.36
8.1.170.0060.00318.66
8.1.160.0040.00422.29
8.1.150.0040.00418.88
8.1.140.0050.00217.69
8.1.130.0040.00418.03
8.1.120.0040.00417.73
8.1.110.0070.00317.75
8.1.100.0000.00917.70
8.1.90.0000.00817.73
8.1.80.0020.00517.71
8.1.70.0000.00717.64
8.1.60.0000.00817.89
8.1.50.0040.00417.74
8.1.40.0060.00317.77
8.1.30.0090.00017.98
8.1.20.0040.00417.87
8.1.10.0040.00417.86
8.1.00.0030.00817.85
8.0.300.0030.00618.77
8.0.290.0040.00417.18
8.0.280.0000.00818.76
8.0.270.0030.00317.54
8.0.260.0030.00317.02
8.0.250.0030.00317.14
8.0.240.0040.00417.24
8.0.230.0040.00417.23
8.0.220.0030.00317.08
8.0.210.0030.00317.17
8.0.200.0000.00917.12
8.0.190.0000.00817.29
8.0.180.0050.00317.25
8.0.170.0080.00017.17
8.0.160.0070.00017.13
8.0.150.0000.00817.08
8.0.140.0050.00317.19
8.0.130.0030.00313.53
8.0.120.0050.00317.12
8.0.110.0040.00417.15
8.0.100.0030.00516.98
8.0.90.0030.00517.13
8.0.80.0090.00617.18
8.0.70.0080.00017.20
8.0.60.0040.00416.98
8.0.50.0000.00716.96
8.0.30.0030.01917.26
8.0.20.0090.01017.60
8.0.10.0030.00317.35
8.0.00.0090.01217.13
7.4.330.0050.00015.00
7.4.320.0060.00016.82
7.4.300.0000.00616.77
7.4.290.0000.00716.68
7.4.280.0000.00616.91
7.4.270.0030.00316.79
7.4.260.0030.00616.76
7.4.250.0000.00816.81
7.4.240.0030.00516.78
7.4.230.0080.00016.72
7.4.220.0120.00916.75
7.4.210.0110.00516.86
7.4.200.0050.00216.98
7.4.190.0000.00716.95
7.4.160.0130.00316.81
7.4.150.0090.00917.40
7.4.140.0050.01317.86
7.4.130.0050.01316.74
7.4.120.0100.00716.90
7.4.110.0070.01116.75
7.4.100.0090.01216.84
7.4.90.0120.00617.01
7.4.80.0080.00819.39
7.4.70.0040.01216.65
7.4.60.0140.00316.69
7.4.50.0000.00816.93
7.4.40.0030.01422.77
7.4.30.0100.00716.65
7.4.00.0070.00815.26
7.3.330.0030.00313.46
7.3.320.0030.00313.43
7.3.310.0030.00316.67
7.3.300.0040.00416.59
7.3.290.0090.00616.64
7.3.280.0070.01116.62
7.3.270.0030.01417.40
7.3.260.0140.00617.04
7.3.250.0100.01016.57
7.3.240.0030.01516.73
7.3.230.0120.00616.91
7.3.210.0100.00716.70
7.3.200.0090.00919.39
7.3.190.0000.02316.71
7.3.180.0140.00716.89
7.3.170.0030.01816.84
7.3.160.0130.01016.89
7.3.120.0120.00314.89
7.3.10.0140.00016.71
7.3.00.0100.00616.74
7.2.330.0160.00317.13
7.2.320.0080.00817.06
7.2.310.0100.01017.02
7.2.300.0130.00616.79
7.2.290.0140.00517.12
7.2.130.0040.01116.89
7.2.120.0070.00716.98
7.2.110.0000.01017.14
7.2.100.0100.00617.01
7.2.90.0030.00916.88
7.2.80.0040.01116.89
7.2.70.0090.00617.13
7.2.60.0090.00617.12
7.2.50.0030.01017.11
7.2.40.0030.01017.00
7.2.30.0070.00717.08
7.2.20.0030.01017.00
7.2.10.0090.00617.00
7.2.00.0070.00718.39
7.1.250.0040.01116.01
7.1.100.0000.01018.00
7.1.70.0110.00417.42
7.1.60.0030.02119.43
7.1.50.0070.01517.08
7.1.00.0030.03322.57
7.0.200.0040.00416.98
7.0.140.0070.07322.23
7.0.60.0030.07019.97
7.0.50.0070.08317.89
7.0.40.0130.05020.13
7.0.30.0300.07020.25
7.0.20.0170.04020.20
7.0.10.0300.07720.13
7.0.00.0070.09320.20
5.6.280.0070.06321.17
5.6.210.0030.06720.54
5.6.200.0000.06018.23
5.6.190.0200.08020.80
5.6.180.0300.08020.49
5.6.170.0330.04720.53
5.6.160.0030.04320.51
5.6.150.0070.04318.23
5.6.140.0030.04318.29
5.6.130.0070.06318.25
5.6.120.0100.07321.19
5.6.110.0100.04021.07
5.6.100.0000.09321.20
5.6.90.0070.07721.09
5.6.80.0070.07720.58
5.6.70.0330.07020.43
5.5.350.0100.03020.44
5.5.340.0070.03718.12
5.5.330.0130.04020.54
5.5.320.0200.03720.50
5.5.310.0170.04020.47
5.5.300.0070.04318.06
5.5.290.0070.04718.07
5.5.280.0070.06721.03
5.5.270.0000.04320.91
5.5.260.0100.08021.09
5.5.250.0170.07020.70
5.5.240.0100.07020.48
5.4.450.0100.07719.49
5.4.440.3670.03719.60
5.4.430.3770.04319.64
5.4.420.3500.04019.49
5.4.410.4200.03019.52
5.4.400.5230.04019.34
5.4.390.3500.03319.02
5.4.380.3800.03319.32
5.4.370.3770.03719.13
5.4.360.4000.03319.07
5.4.350.3500.04319.16
5.4.340.4470.03719.32
5.4.320.3870.03719.33
5.4.310.3600.03019.02
5.4.300.3470.04019.23
5.4.290.3630.03019.21
5.4.280.3870.03719.03
5.4.270.3970.03318.99
5.4.260.4330.03319.17
5.4.250.3770.04019.02
5.4.240.3870.03018.99
5.4.230.3570.03319.06
5.4.220.3800.03719.00
5.4.210.3900.04019.30
5.4.200.3830.04019.00
5.4.190.3530.03719.13
5.4.180.3630.03318.98
5.4.170.3330.03318.98
5.4.160.3470.03719.05
5.4.150.2970.04019.27
5.4.140.3030.03316.36
5.4.130.3100.03016.58
5.4.120.3200.03716.55
5.4.110.3130.03716.60
5.4.100.3500.04016.64
5.4.90.4030.03716.64
5.4.80.3670.03316.54
5.4.70.3370.03316.42
5.4.60.4000.04016.44
5.4.50.3530.03716.53
5.4.40.4370.04016.57
5.4.30.4470.03716.59
5.4.20.4330.03716.61
5.4.10.4170.03716.38
5.4.00.4430.04016.01
5.3.290.3570.03714.71
5.3.280.3770.03314.79
5.3.270.2400.03014.55
5.3.260.3530.04014.65
5.3.250.3570.03714.71
5.3.240.3170.02714.61
5.3.230.3070.04014.64
5.3.220.3530.03714.58
5.3.210.3230.04014.55
5.3.200.3300.03714.74
5.3.190.4270.04714.57
5.3.180.3730.03714.56
5.3.170.3700.03014.50
5.3.160.3500.04314.57
5.3.150.3600.03714.50
5.3.140.4800.03014.48
5.3.130.4300.04014.54
5.3.120.4230.03714.73
5.3.110.4630.02314.59
5.3.100.4500.03714.23
5.3.90.4600.03314.17
5.3.80.4330.03314.12
5.3.70.4200.03714.01
5.3.60.3900.03013.99
5.3.50.3930.03714.07
5.3.40.3730.04013.82
5.3.30.3770.03713.92
5.3.20.3770.03713.66
5.3.10.4300.03313.86
5.3.00.4500.03013.68
5.2.170.2900.02711.07
5.2.160.2870.02711.13
5.2.150.3370.03011.25
5.2.140.3470.03011.09
5.2.130.3570.02711.34
5.2.120.3570.03011.08
5.2.110.3730.03311.27
5.2.100.3430.02711.05
5.2.90.3630.03011.24
5.2.80.3830.02711.23
5.2.70.3700.03011.08
5.2.60.3630.02710.99
5.2.50.3730.03011.01
5.2.40.2800.02711.12
5.2.30.3170.02711.22
5.2.20.3070.02710.98
5.2.10.3270.03010.96
5.2.00.2900.03310.75
5.1.60.2630.02310.21
5.1.50.2600.02010.21
5.1.40.2730.02710.23
5.1.30.2800.03010.48
5.1.20.2370.02310.60
5.1.10.2600.02310.21
5.1.00.2670.02710.21
5.0.50.1500.02710.21
5.0.40.1170.02310.21
5.0.30.1270.02710.21
5.0.20.1830.01710.21
5.0.10.1430.02010.21
5.0.00.1600.03310.21
4.4.90.1730.01010.21
4.4.80.1400.01710.21
4.4.70.1730.01710.21
4.4.60.1730.01710.21
4.4.50.1430.01310.21
4.4.40.1530.02310.21
4.4.30.1530.01710.21
4.4.20.1130.01310.21
4.4.10.1130.01710.21
4.4.00.1400.02310.21
4.3.110.1370.01710.21
4.3.100.1430.01710.21
4.3.90.1400.01310.21
4.3.80.1670.02010.21
4.3.70.1670.02010.21
4.3.60.1600.01010.21
4.3.50.1630.02010.21
4.3.40.1700.03010.21
4.3.30.0900.02010.21
4.3.20.0970.02710.21
4.3.10.1000.02010.21
4.3.00.1030.02010.21

preferences:
42.31 ms | 401 KiB | 5 Q