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); }  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.0100.00718.55
8.3.50.0080.01021.98
8.3.40.0140.00418.67
8.3.30.0110.01118.92
8.3.20.0070.00020.29
8.3.10.0040.00421.88
8.3.00.0040.00417.92
8.2.180.0150.00616.38
8.2.170.0140.00722.96
8.2.160.0100.00320.29
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00821.10
8.2.110.0100.00020.52
8.2.100.0110.00017.47
8.2.90.0030.00617.50
8.2.80.0030.00517.97
8.2.70.0030.00517.49
8.2.60.0050.00517.90
8.2.50.0100.00018.07
8.2.40.0050.00217.97
8.2.30.0040.00417.88
8.2.20.0070.00017.53
8.2.10.0040.00417.80
8.2.00.0070.00017.45
8.1.280.0110.00425.92
8.1.270.0040.00423.76
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0030.00618.89
8.1.230.0040.00717.70
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0110.00017.10
8.1.190.0080.00016.98
8.1.180.0080.00018.10
8.1.170.0030.00618.35
8.1.160.0040.00421.82
8.1.150.0000.00718.79
8.1.140.0040.00717.19
8.1.130.0030.00317.72
8.1.120.0000.00717.32
8.1.110.0040.00417.36
8.1.100.0040.00417.23
8.1.90.0040.00417.27
8.1.80.0030.00517.32
8.1.70.0030.00517.26
8.1.60.0050.00317.39
8.1.50.0070.00017.42
8.1.40.0000.00717.29
8.1.30.0000.00817.49
8.1.20.0000.00817.34
8.1.10.0050.00217.29
8.1.00.0000.00817.23
8.0.300.0040.00418.77
8.0.290.0040.00416.58
8.0.280.0040.00418.30
8.0.270.0050.00317.10
8.0.260.0030.00317.06
8.0.250.0060.00316.82
8.0.240.0030.00516.74
8.0.230.0030.00316.78
8.0.220.0030.00316.77
8.0.210.0020.00516.64
8.0.200.0060.00016.73
8.0.190.0000.00816.82
8.0.180.0070.00016.67
8.0.170.0060.00316.76
8.0.160.0030.00316.86
8.0.150.0030.00316.74
8.0.140.0100.00016.77
8.0.130.0040.00413.43
8.0.120.0000.00816.58
8.0.110.0040.00416.76
8.0.100.0030.00616.55
8.0.90.0070.00016.73
8.0.80.0080.00616.71
8.0.70.0040.00416.59
8.0.60.0080.00016.61
8.0.50.0050.00316.80
8.0.30.0140.00717.13
8.0.20.0090.01017.40
8.0.10.0040.00416.82
8.0.00.0080.01116.56
7.4.330.0050.00015.00
7.4.320.0060.00016.32
7.4.300.0060.00016.35
7.4.290.0000.00716.23
7.4.280.0070.00016.45
7.4.270.0030.00316.46
7.4.260.0030.00316.35
7.4.250.0070.00016.43
7.4.240.0060.00216.35
7.4.230.0000.00716.56
7.4.220.0040.01416.42
7.4.210.0060.00816.51
7.4.200.0030.00316.18
7.4.160.0190.00016.43
7.4.150.0150.00317.40
7.4.140.0100.01117.86
7.4.130.0120.00616.45
7.4.120.0140.00216.42
7.4.110.0030.01316.33
7.4.100.0090.01516.55
7.4.90.0100.00716.23
7.4.80.0070.01019.39
7.4.70.0130.00316.46
7.4.60.0120.00316.28
7.4.50.0040.00016.29
7.4.40.0070.01616.31
7.4.30.0100.01016.50
7.3.330.0000.00512.95
7.3.320.0060.00012.97
7.3.310.0030.00316.23
7.3.300.0070.00016.13
7.3.290.0070.01016.17
7.3.280.0110.00416.13
7.3.270.0070.01017.40
7.3.260.0090.01516.25
7.3.250.0100.01016.30
7.3.240.0090.00616.02
7.3.230.0080.00816.52
7.3.210.0100.00616.52
7.3.200.0080.00919.39
7.3.190.0070.01016.39
7.3.180.0100.00716.14
7.3.170.0070.01016.32
7.3.160.0120.00316.49
7.2.330.0090.01316.50
7.2.320.0130.00316.14
7.2.310.0090.01316.41
7.2.300.0060.01016.50
7.2.290.0100.00616.37
5.4.320.0060.03812.45
5.4.310.0070.03712.45
5.4.300.0140.03012.45
5.4.290.0050.04212.45
5.4.280.0080.03312.34
5.4.270.0040.03812.35
5.4.260.0070.03712.34
5.4.250.0070.03712.34
5.4.240.0090.03512.34
5.4.230.0050.04212.33
5.4.220.0080.03312.34
5.4.210.0050.03912.34
5.4.200.0060.04012.34
5.4.190.0090.03412.33
5.4.180.0090.03612.34
5.4.170.0080.03812.35
5.4.160.0060.04312.34
5.4.150.0050.03812.34
5.4.140.0070.04212.02
5.4.130.0100.03212.01
5.4.120.0080.04611.96
5.4.110.0110.03911.96
5.4.100.0080.03411.96
5.4.90.0100.03411.96
5.4.80.0060.03611.96
5.4.70.0060.04011.96
5.4.60.0060.03411.96
5.4.50.0060.03511.96
5.4.40.0070.03511.95
5.4.30.0080.04011.95
5.4.20.0070.03511.95
5.4.10.0070.03511.95
5.4.00.0040.03711.43
5.3.290.0040.04812.80
5.3.280.0110.03412.71
5.3.270.0060.04112.72
5.3.260.0070.03812.72
5.3.250.0070.03612.72
5.3.240.0060.04312.72
5.3.230.0050.03912.71
5.3.220.0110.04312.68
5.3.210.0100.05412.68
5.3.200.0090.04512.68
5.3.190.0110.03812.68
5.3.180.0080.03712.67
5.3.170.0090.04512.67
5.3.160.0050.04612.67
5.3.150.0060.03612.67
5.3.140.0100.03612.66
5.3.130.0100.03812.66
5.3.120.0080.03712.66
5.3.110.0070.04012.66
5.3.100.0070.04912.12
5.3.90.0090.03412.09
5.3.80.0050.04012.07
5.3.70.0100.04012.07
5.3.60.0100.04412.06
5.3.50.0080.03612.00
5.3.40.0080.04712.00
5.3.30.0080.03511.94
5.3.20.0060.03911.71
5.3.10.0040.04611.69
5.3.00.0090.04411.67

preferences:
44.63 ms | 401 KiB | 5 Q