3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $mConnectProfile = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><mc-profile-response><mc-response><code>0</code><message>Service successfully ended</message></mc-response><mc-profile><username>petermueller</username><gender>M</gender><firstname>Muster</firstname><lastname>Peter</lastname><email>peter.muster@info.ch</email><street>Strasse</street><streetnumber>34a</streetnumber><zip>8888</zip><city>Musterhausen</city><country>CH</country><mobilenumber>079 737 37 37</mobilenumber><additional-address>Addresszusatz 888</additional-address></mc-profile></mc-profile-response>'); var_dump((array) $mConnectProfile->{'mc-profile'});
based on jhFPE
Output for 5.3.23 - 7.3.0alpha1
array(12) { ["username"]=> string(12) "petermueller" ["gender"]=> string(1) "M" ["firstname"]=> string(6) "Muster" ["lastname"]=> string(5) "Peter" ["email"]=> string(20) "peter.muster@info.ch" ["street"]=> string(7) "Strasse" ["streetnumber"]=> string(3) "34a" ["zip"]=> string(4) "8888" ["city"]=> string(12) "Musterhausen" ["country"]=> string(2) "CH" ["mobilenumber"]=> string(13) "079 737 37 37" ["additional-address"]=> string(17) "Addresszusatz 888" }