3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = simplexml_load_string('<a><![CDATA[OK]]></a>', null, LIBXML_NOCDATA ); var_dump($xml); var_dump($xml['a']); var_dump($xml->a);
based on Z8jLg
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
object(SimpleXMLElement)#1 (1) { [0]=> string(2) "OK" } NULL object(SimpleXMLElement)#2 (0) { }
Output for hhvm-3.15.4
Warning: simplexml_load_string() expects parameter 2 to be string, null given in /in/eccaO on line 3 NULL NULL Notice: Cannot access property on non-object in /in/eccaO on line 6 NULL