3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s1 = '<?xml version="1.0"?> <!DOCTYPE lolz [ <!ENTITY lol "lol"> <!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;"> <!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;"> <!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;"> <!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;"> <!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;"> <!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;"> <!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;"> <!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;"> <!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;"> ]> <lolz>&lol9;</lolz>'; $s2 = '<?xml version="1.0"?><!DOCTYPE kaboom [ <!ENTITY a "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"> ]> <kaboom>&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;</kaboom>'; $doc = new DOMDocument(); $doc->loadXML($s1); echo strlen($doc->lastChild->nodeValue); $doc = new DOMDocument(); $doc->loadXML($s2); echo strlen($doc->lastChild->nodeValue);
based on s30Yr
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 1 in /in/oEWFn on line 23 Warning: DOMDocument::loadXML(): Detected an entity reference loop in Entity, line: 14 in /in/oEWFn on line 23 Notice: Trying to get property of non-object in /in/oEWFn on line 24 05248
Output for hhvm-3.10.0 - 3.12.0
Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 1 Warning: Detected an entity reference loop in Entity, line: 14 Notice: Cannot access property on non-object in /in/oEWFn on line 24 05248
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/oEWFn on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/oEWFn on line 22