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();

This is an error 404

There are `0` results


preferences:
146.6 ms | 1399 KiB | 7 Q