3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<<XML <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <GetContact_tResponse xmlns="http://api.mymip.be/"> <GetContact_tResult> <returnStatus> <errorNumber>0</errorNumber> <errorMessage>OK</errorMessage> </returnStatus> <data> <creation>2013-05-02T09:02:00.100</creation> <created_by>sa</created_by> <modification>2013-11-09T17:47:32.433</modification> <modified_by>dbo</modified_by> <URN>D00000196</URN> <conieID>1</conieID> <conseID>1</conseID> <ContactRelationTouchPoints/> <ContactUniqueIds/> <ContactPermissions> <ContactPermission> <creation>2013-11-19T18:31:39.340</creation> <created_by>test</created_by> <permID>111</permID> <URN>D00000196</URN> <inOut>O</inOut> <isExplicit>1</isExplicit> <cbpID>1</cbpID> <cbpCode description="Default : All">01000000000</cbpCode> <channelCode description="Mobile sms/text">SMS</channelCode> </ContactPermission> </ContactPermissions> <ContactRelationAttributes> <ContactRelationAttribute> <creation>2013-05-02T09:02:00.127</creation> <created_by>sa</created_by> <relabID>1</relabID> <URN>D00000196</URN> <value/> <relabCode description="Is Parent of family">PARENT</relabCode> </ContactRelationAttribute> </ContactRelationAttributes> <ContactIndividualEntity> <creation>2013-05-02T09:01:59.967</creation> <created_by>sa</created_by> <modification>2013-11-09T17:26:40.267</modification> <modified_by>dbo</modified_by> <conieID>1</conieID> <firstName>dfjcuzn</firstName> <familyName>fgrvphokma</familyName> <dob>2013-08-13</dob> <ContactIndividualAttributes> <ContactIndividualAttribute> <creation>2013-05-02T09:02:00.033</creation> <created_by>sa</created_by> <coniaID>1</coniaID> <conieID>1</conieID> <value>FCO</value> <coniaCode description="Nickname">NICK</coniaCode> </ContactIndividualAttribute> </ContactIndividualAttributes> <genderCode description="Male">M</genderCode> <languageCode description="Dutch">nl</languageCode> <titleCode description="Default" salutation="De Heer">0</titleCode> <conieStatusCode description="Valid" isValid="0">V</conieStatusCode> </ContactIndividualEntity> <ContactSocialEntity> <creation>2013-05-02T09:02:00.050</creation> <created_by>sa</created_by> <modification>2013-11-09T17:26:51.320</modification> <modified_by>dbo</modified_by> <conseID>1</conseID> <conseCode description="Family">FAM</conseCode> <name>foo</name> <languageCode description="Dutch">nl</languageCode> <legalFormCode description="No legalFormCode"/> <conseStatusCode description="Valid" isValid="0">V</conseStatusCode> <ContactSocialAttributes/> </ContactSocialEntity> <languageCode description="Dutch">nl</languageCode> </data> </GetContact_tResult> </GetContact_tResponse> </soap:Body> </soap:Envelope> XML; $doc = new DOMDocument(); $doc->loadXML($xml); $xpath = new DOMXpath($doc); $xpath->registerNamespace("api", "http://api.mymip.be/"); var_dump($xpath->query('//*[local-name()="ContactPermission"]')->item(0));
Output for 5.3.11 - 5.3.29, 5.4.1 - 5.6.28, 7.0.0 - 7.1.0
object(DOMElement)#3 (18) { ["tagName"]=> string(17) "ContactPermission" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(17) "ContactPermission" ["nodeValue"]=> string(204) " 2013-11-19T18:31:39.340 test 111 D00000196 O 1 1 01000000000 SMS " ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> string(22) "(object value omitted)" ["nextSibling"]=> string(22) "(object value omitted)" ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> string(20) "http://api.mymip.be/" ["prefix"]=> string(0) "" ["localName"]=> string(17) "ContactPermission" ["baseURI"]=> string(1) "/" ["textContent"]=> string(204) " 2013-11-19T18:31:39.340 test 111 D00000196 O 1 1 01000000000 SMS " }
Output for hhvm-3.10.0 - 3.12.0
object(DOMElement)#3 (18) { ["nodeName"]=> string(17) "ContactPermission" ["nodeValue"]=> string(204) " 2013-11-19T18:31:39.340 test 111 D00000196 O 1 1 01000000000 SMS " ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> string(22) "(object value omitted)" ["nextSibling"]=> string(22) "(object value omitted)" ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> string(20) "http://api.mymip.be/" ["prefix"]=> string(0) "" ["localName"]=> string(17) "ContactPermission" ["baseURI"]=> string(1) "/" ["textContent"]=> string(204) " 2013-11-19T18:31:39.340 test 111 D00000196 O 1 1 01000000000 SMS " ["tagName"]=> string(17) "ContactPermission" ["schemaTypeInfo"]=> NULL }
Output for 5.0.0 - 5.3.10, 5.4.0
object(DOMElement)#3 (0) { }
Output for 4.4.3 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/Mn9SX on line 95
Process exited with code 255.
Output for 4.4.2
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/Mn9SX on line 96
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/Mn9SX on line 95
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Mn9SX on line 95
Process exited with code 255.