3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<?xml version="1.0" encoding="UTF-8"?> <sv:node xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"> <sv:property sv:name="jcr:created" sv:type="date" sv:multi-valued="0"> <sv:value>2013-11-11T14:50:35+01:00</sv:value> </sv:property> <sv:property sv:name="jcr:created" sv:type="date" sv:multi-valued="0"> <sv:value>2014-11-11T14:50:35+01:00</sv:value> </sv:property> <sv:property sv:name="jcr:created" sv:type="date" sv:multi-valued="0"> <sv:value>2015-11-11T14:50:35+01:00</sv:value> </sv:property> </sv:node>'; $expression = '//*[text()<"2014-11-11T14:50:35+01:00"]'; $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->loadXML($string); $xpath = new \DOMXPath($dom); $r = $xpath->evaluate($expression); var_dump($r); var_dump($r->item(0));
Output for 5.3.11 - 5.3.29, 5.4.1 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
object(DOMNodeList)#3 (1) { ["length"]=> int(0) } NULL
Output for 5.3.0 - 5.3.10, 5.4.0
object(DOMNodeList)#3 (0) { } NULL
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 22 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 24 object(DOMNodeList)#3 (0) { } NULL
Output for 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 22 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 24 Fatal error: Call to undefined method DOMXPath::evaluate() in /in/XSWgB on line 25
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 22 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 24 Fatal error: Cannot instantiate non-existent class: domdocument in /in/XSWgB on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 22 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/XSWgB on line 24 Fatal error: Cannot instantiate non-existent class: domdocument in /in/XSWgB on line 22

preferences:
276.4 ms | 401 KiB | 456 Q