3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <data> <prod id="1"> <layer id="layer_0" imgSRC="data/361_layer_0.png"/> <layer id="layer_1" imgSRC="data/362_layer_0.png"/> <layer id="layer_2" imgSRC="data/363_layer_0.png"/> </prod> <prod id="2"> <layer id="layer_0" imgSRC="data/361_layer_0.png"/> <layer id="layer_1" imgSRC="data/362_layer_0.png"/> <layer id="layer_2" imgSRC="data/363_layer_0.png"/> </prod> </data> XML; $xml = simplexml_load_string($x); // assuming XML in $x $node = $xml->xpath("//prod[@id='2']/layer[@id='layer_2']")[0]; $new = $node->addChild("layer",""); $new->addAttribute("id", "layer_3"); var_dump ($new);

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.00618.68
8.3.50.0170.00622.04
8.3.40.0110.00419.04
8.3.30.0110.00419.04
8.3.20.0090.00018.98
8.3.10.0000.00821.40
8.3.00.0070.00022.01
8.2.180.0110.00418.66
8.2.170.0100.00422.96
8.2.160.0140.00020.95
8.2.150.0000.00924.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00021.28
8.2.110.0030.00622.70
8.2.100.0040.00818.03
8.2.90.0000.00819.46
8.2.80.0050.00318.41
8.2.70.0080.00017.88
8.2.60.0060.00318.28
8.2.50.0040.00418.07
8.2.40.0060.00318.53
8.2.30.0050.00321.67
8.2.20.0000.00818.14
8.2.10.0050.00318.09
8.2.00.0000.00818.00
8.1.280.0070.01425.92
8.1.270.0000.00823.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.70
8.1.230.0090.00321.22
8.1.220.0080.00018.77
8.1.210.0060.00319.22
8.1.200.0030.00617.50
8.1.190.0040.00417.78
8.1.180.0000.00818.10
8.1.170.0030.00518.77
8.1.160.0040.00419.23
8.1.150.0080.00018.77
8.1.140.0030.00517.88
8.1.130.0030.00318.23
8.1.120.0040.00417.87
8.1.110.0000.00817.76
8.1.100.0050.00317.63
8.1.90.0040.00417.68
8.1.80.0040.00417.57
8.1.70.0000.00817.82
8.1.60.0060.00317.91
8.1.50.0000.00717.76
8.1.40.0040.00417.88
8.1.30.0030.00517.72
8.1.20.0040.00417.81
8.1.10.0030.00517.68
8.1.00.0030.00517.61
8.0.300.0040.00420.11
8.0.290.0000.00717.54
8.0.280.0070.00018.64
8.0.270.0000.00717.50
8.0.260.0030.00317.10
8.0.250.0000.00817.16
8.0.240.0000.00717.41
8.0.230.0030.00317.19
8.0.220.0030.00517.29
8.0.210.0050.00217.14
8.0.200.0030.00517.41
8.0.190.0000.00717.15
8.0.180.0000.00817.23
8.0.170.0070.00017.31
8.0.160.0040.00417.38
8.0.150.0000.00717.09
8.0.140.0050.00217.09
8.0.130.0000.00613.78
8.0.120.0050.00317.11
8.0.110.0000.00717.21
8.0.100.0000.00717.32
8.0.90.0030.00517.32
8.0.80.0140.00317.38
8.0.70.0020.00517.11
8.0.60.0000.00717.12
8.0.50.0040.00417.14
8.0.30.0050.01417.34
8.0.20.0010.01917.42
8.0.10.0000.00717.26
8.0.00.0090.00917.01
7.4.330.0000.00617.05
7.4.320.0030.00316.84
7.4.300.0060.00016.76
7.4.290.0000.00816.65
7.4.280.0040.00416.81
7.4.270.0000.00716.75
7.4.260.0000.00513.61
7.4.250.0000.00816.75
7.4.240.0070.00016.84
7.4.230.0070.00016.79
7.4.220.0070.01316.77
7.4.210.0060.00816.85
7.4.200.0040.00416.84
7.4.190.0040.00417.11
7.4.160.0110.00516.68
7.4.150.0060.01117.40
7.4.140.0090.00817.86
7.4.130.0150.00316.73
7.4.120.0070.00917.04
7.4.110.0070.01016.88
7.4.100.0110.01116.92
7.4.90.0110.00816.73
7.4.80.0170.00019.39
7.4.70.0030.01716.74
7.4.60.0080.00816.92
7.4.50.0000.00816.63
7.4.40.0040.00822.77
7.4.30.0070.01016.87
7.4.00.0090.01015.07
7.3.330.0030.00213.44
7.3.320.0000.00613.55
7.3.310.0030.00316.76
7.3.300.0070.00016.52
7.3.290.0140.00016.52
7.3.280.0100.00816.58
7.3.270.0100.00717.40
7.3.260.0080.01018.24
7.3.250.0110.00616.69
7.3.240.0070.01016.57
7.3.230.0070.01116.56
7.3.210.0070.01116.96
7.3.200.0090.00819.39
7.3.190.0200.00316.73
7.3.180.0130.00316.52
7.3.170.0130.00316.83
7.3.160.0160.00016.67
7.3.120.0080.01014.86
7.3.110.0080.01114.94
7.3.100.0000.01214.90
7.3.90.0110.00615.04
7.3.80.0100.00615.05
7.3.70.0090.00914.93
7.3.60.0080.00814.88
7.3.50.0070.01014.88
7.3.40.0030.01014.82
7.3.30.0050.00914.92
7.3.20.0100.00516.67
7.3.10.0080.00816.75
7.3.00.0030.00816.59
7.2.330.0070.01116.88
7.2.320.0030.01617.16
7.2.310.0110.00616.93
7.2.300.0060.01017.13
7.2.290.0130.00616.74
7.2.250.0060.01515.22
7.2.240.0070.01415.04
7.2.230.0040.01515.01
7.2.220.0090.00515.06
7.2.210.0030.01515.30
7.2.200.0080.00815.14
7.2.190.0040.01015.16
7.2.180.0100.00715.07
7.2.170.0110.00314.99
7.2.00.0040.01119.53
7.1.330.0070.00916.01
7.1.320.0070.00815.78
7.1.310.0080.01015.81
7.1.300.0070.00815.89
7.1.290.0080.00715.89
7.1.280.0110.00515.91
7.1.270.0090.00615.86
7.1.260.0020.01216.01
7.1.100.0000.01118.10
7.1.70.0030.00517.00
7.1.60.0070.01819.40
7.1.50.0070.01517.17
7.1.00.0030.06722.63
7.0.200.0100.01016.51
7.0.140.0030.07322.37
7.0.60.0070.06720.14
7.0.50.0000.08717.96
7.0.40.0070.05020.35
7.0.30.0430.05020.37
7.0.20.0200.05020.39
7.0.10.0030.05720.45
7.0.00.0070.04020.31
5.6.280.0070.07021.14
5.6.210.0070.08020.84
5.6.200.0030.08318.33
5.6.190.0030.05720.72
5.6.180.0130.07320.89
5.6.170.0300.05020.61
5.6.160.0030.04320.64
5.6.150.0130.07318.37
5.6.140.0000.07318.41
5.6.130.0100.07718.37
5.6.120.0100.08021.27
5.6.110.0130.08021.26
5.6.100.0070.06321.27
5.6.90.0100.08321.07
5.6.80.0100.07320.69
5.5.350.0030.08020.56
5.5.340.0100.07318.16
5.5.330.0070.08020.39
5.5.320.0330.06720.53
5.5.310.0270.08320.56
5.5.300.0070.04718.15
5.5.290.0100.07318.20
5.5.280.0070.04721.00
5.5.270.0030.04020.84
5.5.260.0100.07721.09
5.5.250.0070.04020.81
5.5.240.0230.03720.52
5.4.450.3030.04019.51
5.4.440.2970.04019.39
5.4.430.2900.04019.57
5.4.420.2430.04019.58
5.4.410.2200.03319.44
5.4.400.2470.04019.04
5.4.390.2630.03719.38
5.4.380.2370.03719.46
5.4.370.3270.04019.07
5.4.360.2330.04019.08
5.4.350.2370.03319.32
5.4.340.2370.03719.38
5.4.320.2330.03719.24
5.4.310.2330.03719.09
5.4.300.2300.04019.23
5.4.290.2570.02719.41
5.4.280.2500.04319.39
5.4.270.2300.04019.28
5.4.260.2600.04019.32
5.4.250.2370.03319.12
5.4.240.2400.03019.06
5.4.230.2600.03319.23
5.4.220.2570.03719.08
5.4.210.2400.04019.40
5.4.200.2430.04319.08
5.4.190.2600.04019.23
5.4.180.2670.03319.20
5.4.170.2330.04319.29
5.4.160.2170.03719.36
5.4.150.2500.03719.05
5.4.140.2370.03716.52
5.4.130.2670.04016.54
5.4.120.2530.03716.54
5.4.110.2930.03716.34
5.4.100.2600.03016.52
5.4.90.2730.04016.56
5.4.80.2230.03716.58
5.4.70.2770.03716.42
5.4.60.2600.04016.55
5.4.50.2570.04016.52
5.4.40.2830.03016.56
5.4.30.2700.03016.41
5.4.20.2430.03016.57
5.4.10.2530.03716.62
5.4.00.2630.04016.00
5.3.290.2770.03714.53
5.3.280.2730.03314.46
5.3.270.2400.03014.44
5.3.260.2430.04314.44
5.3.250.2570.04014.55
5.3.240.2470.05014.56
5.3.230.2470.03714.43
5.3.220.2470.04714.47
5.3.210.2500.04014.61
5.3.200.2670.04014.66
5.3.190.2500.04314.51
5.3.180.2470.04314.52
5.3.170.2700.03714.51
5.3.160.2470.03314.40
5.3.150.2430.03714.53
5.3.140.2430.03014.57
5.3.130.2600.04314.38
5.3.120.2330.03714.41
5.3.110.2270.03714.46
5.3.100.2400.04013.95
5.3.90.2400.03313.97
5.3.80.2430.03713.85
5.3.70.2500.03313.82
5.3.60.2430.04014.05
5.3.50.2570.03713.79
5.3.40.2330.04014.01
5.3.30.2400.03013.69
5.3.20.2400.03713.64
5.3.10.2300.03713.44
5.3.00.2670.04013.61
5.2.170.1930.03011.00
5.2.160.2030.03011.09
5.2.150.2170.02711.09
5.2.140.2100.03011.15
5.2.130.2200.03310.96
5.2.120.2000.02711.15
5.2.110.2000.03011.01
5.2.100.2570.02310.94
5.2.90.2630.02710.99
5.2.80.2700.03011.25
5.2.70.2400.03711.14
5.2.60.2170.04010.91
5.2.50.2170.03310.93
5.2.40.1730.02710.89
5.2.30.1670.03011.02
5.2.20.1730.03011.02
5.2.10.1700.03310.78
5.2.00.1770.03310.65
5.1.60.1330.02310.18
5.1.50.1570.02010.18
5.1.40.1570.0209.93
5.1.30.1800.02710.33
5.1.20.1770.02310.34
5.1.10.1830.0279.99
5.1.00.1730.02710.03
5.0.50.0730.0208.54
5.0.40.0930.0208.33
5.0.30.0900.0338.14
5.0.20.0600.0208.30
5.0.10.0730.0238.28
5.0.00.0800.0308.30
4.4.90.0800.0137.88
4.4.80.0000.0177.88
4.4.70.0000.0177.88
4.4.60.0000.0177.88
4.4.50.0070.0137.88
4.4.40.0000.0277.88
4.4.30.0030.0137.88
4.4.20.0030.0177.88
4.4.10.0000.0177.88
4.4.00.0430.0277.88
4.3.110.0670.0137.88
4.3.100.0630.0137.88
4.3.90.0670.0177.88
4.3.80.0730.0277.88
4.3.70.0600.0177.88
4.3.60.0770.0177.88
4.3.50.0670.0137.88
4.3.40.0630.0237.88
4.3.30.0200.0177.88
4.3.20.0370.0177.88
4.3.10.0430.0177.88
4.3.00.0370.0137.88

preferences:
55.98 ms | 401 KiB | 5 Q