3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new DOMDocument(); $element = $xml->createElement('saml:Assertion'); $xml_saml_assertion = $xml->appendChild($element); $attribute = $xml->createAttribute('id'); $attribute->value = 'IDCard'; $xml_saml_assertion->appendChild($attribute); $attribute = $xml->createAttribute('xmlns:saml'); $attribute->value = 'urn:oasis:names:tc:SAML:2.0:assertion'; $xml_saml_assertion->appendChild($attribute); $attribute = $xml->createAttribute('Version'); $attribute->value = '2.0'; $xml_saml_assertion->appendChild($attribute); var_dump($element->attributes[1]);

preferences:
25.93 ms | 404 KiB | 5 Q