3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MySimpleXMLElement extends SimpleXMLElement { public function appendXML($append){ if ($append) { if (strlen(trim((string)$append)) == 0) { $xml = $this->addChild($append->getName()); } else { $xml = $this->addChild($append->getName(), (string)$append); } var_dump(get_class($xml)); foreach ($append->children() as $child) { $xml->appendXML($child); } foreach ($append->attributes() as $n => $v) { $xml->addAttribute($n, $v); } } } } $currentPayment = new SimpleXMLElement('<payment></payment>'); $currentPayment->addChild('creditCard'); $currentPayment->creditCard->addChild('cardNumber', 'XXXX0027'); $currentPayment->creditCard->addChild('expirationDate', 'XXXX'); $paymentProfile = new MySimpleXMLElement('<paymentProfile></paymentProfile>'); $paymentProfile->appendXML($currentPayment); echo $paymentProfile->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.0110.01118.80
8.3.50.0070.01122.11
8.3.40.0100.00718.92
8.3.30.0070.01419.17
8.3.20.0040.00420.20
8.3.10.0040.00421.85
8.3.00.0080.00018.02
8.2.180.0170.00317.00
8.2.170.0070.00722.96
8.2.160.0110.00320.69
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0120.00321.28
8.2.110.0030.00722.50
8.2.100.0050.00518.16
8.2.90.0040.00419.30
8.2.80.0080.00017.97
8.2.70.0030.00517.88
8.2.60.0000.00918.18
8.2.50.0000.00918.07
8.2.40.0040.00420.01
8.2.30.0070.00018.37
8.2.20.0000.00917.93
8.2.10.0030.00618.37
8.2.00.0040.00417.91
8.1.280.0110.00425.92
8.1.270.0030.00624.05
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00324.09
8.1.230.0080.00319.09
8.1.220.0040.00417.89
8.1.210.0080.00018.77
8.1.200.0090.00317.61
8.1.190.0040.00417.48
8.1.180.0050.00318.10
8.1.170.0000.00818.87
8.1.160.0020.00522.26
8.1.150.0000.00719.17
8.1.140.0000.00817.70
8.1.130.0030.00318.11
8.1.120.0070.00017.70
8.1.110.0040.00417.72
8.1.100.0000.00717.72
8.1.90.0000.00717.76
8.1.80.0000.00717.61
8.1.70.0030.00317.59
8.1.60.0030.00617.86
8.1.50.0080.00017.79
8.1.40.0040.00417.74
8.1.30.0040.00417.89
8.1.20.0040.00417.80
8.1.10.0060.00317.72
8.1.00.0030.00617.79
8.0.300.0040.00418.77
8.0.290.0030.00617.00
8.0.280.0000.00718.57
8.0.270.0000.00817.50
8.0.260.0000.00617.37
8.0.250.0030.00617.18
8.0.240.0040.00417.18
8.0.230.0040.00417.27
8.0.220.0070.00017.17
8.0.210.0000.00817.12
8.0.200.0000.00717.20
8.0.190.0040.00417.19
8.0.180.0040.00417.09
8.0.170.0040.00417.03
8.0.160.0000.00717.15
8.0.150.0030.00517.05
8.0.140.0020.01017.01
8.0.130.0070.00013.50
8.0.120.0030.00617.09
8.0.110.0040.00417.06
8.0.100.0050.00217.09
8.0.90.0080.00017.02
8.0.80.0030.01217.07
8.0.70.0040.00417.14
8.0.60.0070.00017.18
8.0.50.0030.00517.18
8.0.30.0110.01117.38
8.0.20.0070.01317.45
8.0.10.0040.00417.15
8.0.00.0100.01116.94
7.4.330.0000.00615.33
7.4.320.0030.00316.67
7.4.300.0030.00316.82
7.4.290.0030.00316.76
7.4.280.0000.00716.80
7.4.270.0080.00016.72
7.4.260.0030.00516.79
7.4.250.0050.00316.68
7.4.240.0040.00416.77
7.4.230.0000.00716.92
7.4.220.0040.01416.84
7.4.210.0080.00816.67
7.4.200.0000.00716.92
7.4.160.0160.00016.69
7.4.150.0160.00617.40
7.4.140.0070.01417.86
7.4.130.0090.00816.72
7.4.120.0110.00916.87
7.4.110.0000.01716.82
7.4.100.0100.01016.68
7.4.90.0040.01316.79
7.4.80.0120.00919.39
7.4.70.0150.00316.79
7.4.60.0090.00816.72
7.4.50.0030.00516.93
7.4.40.0150.00016.79
7.4.30.0100.01016.69
7.4.00.0060.00914.74
7.3.330.0000.00613.60
7.3.320.0050.00013.48
7.3.310.0050.00316.45
7.3.300.0030.00316.47
7.3.290.0030.01316.63
7.3.280.0100.00716.64
7.3.270.0140.00717.40
7.3.260.0150.00316.82
7.3.250.0120.00516.66
7.3.240.0070.01016.86
7.3.230.0150.00316.90
7.3.210.0130.00316.76
7.3.200.0070.01719.39
7.3.190.0060.01316.67
7.3.180.0100.00716.91
7.3.170.0060.01016.93
7.3.160.0050.01116.68
7.3.120.0070.01014.87
7.3.110.0060.01215.00
7.3.100.0030.01314.73
7.3.90.0030.01214.95
7.3.80.0030.01215.02
7.3.70.0040.00414.99
7.3.60.0000.01414.78
7.3.50.0090.00014.73
7.3.40.0070.00715.01
7.3.30.0030.01015.00
7.3.20.0090.00616.45
7.3.10.0090.00916.66
7.3.00.0040.00816.43
7.2.330.0150.00917.04
7.2.320.0100.00716.71
7.2.310.0140.00316.94
7.2.300.0080.00816.75
7.2.290.0090.00917.15
7.2.240.0120.00415.36
7.2.230.0100.00614.98
7.2.220.0000.00915.33
7.2.210.0080.00615.20
7.2.200.0070.00715.23
7.2.190.0040.01115.26
7.2.180.0030.01015.06
7.2.170.0060.00915.36
7.2.160.0040.01115.13
7.2.150.0070.00716.96
7.2.140.0090.00316.90
7.2.130.0000.01517.12
7.2.120.0090.00617.02
7.2.110.0000.01017.15
7.2.100.0090.00617.22
7.2.90.0040.00717.04
7.2.80.0030.01216.91
7.2.70.0000.01217.00
7.2.60.0050.01117.02
7.2.50.0100.00516.93
7.2.40.0040.00817.29
7.2.30.0030.01017.04
7.2.20.0080.00316.83
7.2.10.0090.00916.85
7.2.00.0050.01118.34
7.1.330.0070.00716.01
7.1.320.0100.00015.75
7.1.310.0110.00015.66
7.1.300.0060.01015.95
7.1.290.0100.00015.89
7.1.280.0030.00615.67
7.1.270.0070.00615.75
7.1.260.0000.01315.61
7.1.250.0060.00815.61
7.1.200.0060.00315.77
7.1.70.0030.00717.35
7.1.60.0000.02519.25
7.1.50.0100.01017.17
7.1.00.0070.07022.43
7.0.200.0060.00617.00
7.0.140.0000.07722.20
7.0.60.0000.08020.12
7.0.50.0000.08717.99
7.0.40.0100.04020.45
7.0.30.0330.07020.32
7.0.20.0230.05320.38
7.0.10.0030.07720.41
7.0.00.0030.07320.29
5.6.280.0100.06721.10
5.6.210.0130.05720.66
5.6.200.0130.07018.39
5.6.190.0070.08320.55
5.6.180.0170.04320.82
5.6.170.0300.05720.59
5.6.160.0000.08720.63
5.6.150.0030.04318.23
5.6.140.0030.07018.38
5.6.130.0070.09018.26
5.6.120.0100.03721.18
5.6.110.0100.03721.19
5.6.100.0230.06021.07
5.6.90.0070.08321.05
5.6.80.0030.08320.60
5.5.350.0170.07020.65
5.5.340.0030.06318.11
5.5.330.0070.05020.57
5.5.320.0330.07020.50
5.5.310.0100.05020.48
5.5.300.0000.05318.16
5.5.290.0070.04018.18
5.5.280.0130.08321.00
5.5.270.0100.05020.96
5.5.260.0100.04320.79
5.5.250.0100.06020.92
5.5.240.0070.07320.35
5.4.450.0730.06019.52
5.4.440.0870.05719.62
5.4.430.0770.05319.62
5.4.420.0730.06019.57
5.4.410.0100.05318.79
5.4.400.0200.06018.77
5.4.390.0500.06018.83
5.4.380.0000.06018.60
5.4.370.0100.05018.91
5.4.360.0130.04718.79
5.4.350.0180.08912.19
5.4.340.0120.04612.19
5.4.320.0060.03912.68
5.4.310.0110.05012.68
5.4.300.0100.04712.68
5.4.290.0080.04612.68
5.4.280.0100.03412.58
5.4.270.0080.03612.57
5.4.260.0070.03812.57
5.4.250.0090.03512.58
5.4.240.0050.04012.57
5.4.230.0060.04012.57
5.4.220.0050.04012.57
5.4.210.0080.04212.56
5.4.200.0050.04212.57
5.4.190.0110.03612.56
5.4.180.0160.04812.56
5.4.170.0130.03312.57
5.4.160.0120.03912.57
5.4.150.0050.04412.56
5.4.140.0070.04012.25
5.4.130.0060.03612.24
5.4.120.0060.03612.20
5.4.110.0110.03912.19
5.4.100.0070.03912.19
5.4.90.0070.04112.19
5.4.80.0060.03812.20
5.4.70.0040.04012.19
5.4.60.0070.03712.19
5.4.50.0030.03712.18
5.4.40.0080.03212.17
5.4.30.0070.04212.16
5.4.20.0040.03912.16
5.4.10.0110.03912.16
5.4.00.0080.03511.66
5.3.290.0090.03912.94
5.3.280.0060.04712.87
5.3.270.0060.04012.88
5.3.260.0060.04112.89
5.3.250.0110.03812.89
5.3.240.0080.04312.89
5.3.230.0050.03912.88
5.3.220.0050.04212.85
5.3.210.0130.04312.84
5.3.200.0080.04712.84
5.3.190.0080.04612.84
5.3.180.0070.03712.85
5.3.170.0070.03812.85
5.3.160.0080.03612.85
5.3.150.0050.03912.84
5.3.140.0060.03812.83
5.3.130.0080.03612.83
5.3.120.0100.03612.82
5.3.110.0050.04212.83
5.3.100.0130.03012.32
5.3.90.0060.03512.30
5.3.80.0080.03712.28
5.3.70.0050.04212.28
5.3.60.0080.03512.28
5.3.50.0080.03812.21
5.3.40.0050.04112.21
5.3.30.0050.03512.18
5.3.20.0050.03511.95
5.3.10.0070.03511.93
5.3.00.0040.03711.91
5.2.170.0050.0339.41
5.2.160.0070.0279.41
5.2.150.0080.0339.41
5.2.140.0020.0359.41
5.2.130.0060.0349.37
5.2.120.0060.0299.37
5.2.110.0030.0329.38
5.2.100.0090.0319.38
5.2.90.0090.0259.37
5.2.80.0060.0369.36
5.2.70.0100.0289.37
5.2.60.0070.0399.32
5.2.50.0040.0309.29
5.2.40.0090.0269.27
5.2.30.0070.0429.25
5.2.20.0050.0289.23
5.2.10.0070.0299.14
5.2.00.0050.0379.00
5.1.60.0060.0258.28
5.1.50.0030.0288.27
5.1.40.0030.0268.25
5.1.30.0040.0268.61
5.1.20.0100.0248.58
5.1.10.0050.0338.30
5.1.00.0080.0228.30
5.0.50.0030.0216.79
5.0.40.0040.0196.64
5.0.30.0040.0316.46
5.0.20.0050.0226.43
5.0.10.0010.0286.41
5.0.00.0050.0296.40
4.4.90.0040.0144.77
4.4.80.0050.0154.75
4.4.70.0030.0174.76
4.4.60.0010.0164.75
4.4.50.0030.0154.77
4.4.40.0040.0264.70
4.4.30.0030.0154.76
4.4.20.0060.0144.84
4.4.10.0030.0164.85
4.4.00.0020.0254.76
4.3.110.0020.0214.67
4.3.100.0020.0164.66
4.3.90.0030.0144.64
4.3.80.0060.0214.58
4.3.70.0010.0164.63
4.3.60.0040.0134.62
4.3.50.0020.0164.63
4.3.40.0020.0244.54
4.3.30.0030.0153.30
4.3.20.0010.0173.28
4.3.10.0010.0163.24
4.3.00.0130.0277.12

preferences:
44.97 ms | 400 KiB | 5 Q