3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = <<<XML <global> <entity_id><![CDATA[82]]></entity_id> <attribute_set_id><![CDATA[9]]></attribute_set_id> <sku><![CDATA[ana_8]]></sku> <erp> <barcode></barcode> </erp> </global> XML; echo json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA));
based on 9KMlM
Output for 5.5.0 - 7.2.0
{"entity_id":"82","attribute_set_id":"9","sku":"ana_8","erp":{"barcode":{}}}