3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml =<<<EOL <TimelineObject> <id><![CDATA[12577372733072486582]]></id> <username><![CDATA[wxid_lj7cpmhigv9h12]]></username> <createTime><![CDATA[1499339667]]></createTime> <contentDescShowType>0</contentDescShowType> <contentDescScene>3</contentDescScene> <private><![CDATA[0]]></private> <contentDesc><![CDATA[?个小时,总感觉腿不是自己的了。[坏笑]\u0003]></contentDesc> <contentattr><![CDATA[0]]></contentattr> <sourceUserName></sourceUserName> <sourceNickName></sourceNickName> <statisticsData></statisticsData> </TimelineObject> EOL; var_dump(simplexml_load_string($xml)); var_dump(simplexml_load_string($xml, null, LIBXML_NOCDATA));
based on B49YD
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: contentDesc line 8 and contentattr in /in/tvc0d on line 19 Warning: simplexml_load_string(): <contentattr><![CDATA[0]]></contentattr> in /in/tvc0d on line 19 Warning: simplexml_load_string(): ^ in /in/tvc0d on line 19 bool(false) Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: contentDesc line 8 and contentattr in /in/tvc0d on line 21 Warning: simplexml_load_string(): <contentattr><![CDATA[0]]></contentattr> in /in/tvc0d on line 21 Warning: simplexml_load_string(): ^ in /in/tvc0d on line 21 bool(false)
Output for hhvm-3.15.4
bool(false) Warning: simplexml_load_string() expects parameter 2 to be string, null given in /in/tvc0d on line 21 NULL Entity: line 9: parser error : Opening and ending tag mismatch: contentDesc line 8 and contentattr <contentattr><![CDATA[0]]></contentattr> ^