3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $response = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value> <struct> <member> <name>mainKeyNumber</name> <value>PLSK.10009166.0000</value> </member> <member> <name>expirationDate</name> <value> <dateTime.iso8601>20121229T00:00:00</dateTime.iso8601> </value> </member> <member> <name>productKey</name> <value>A01E00-BYEY10-H0F200-6QFP91-NHF966</value> </member> <member> <name>additionalKeysNumbers</name> <value> <array> <data> <value>KAV.10009167.0000</value> <value>APS.10009168.0000</value> <value>KAV.10009169.0000</value> </data> </array> </value> </member> <member> <name>resultCode</name> <value> <int>100</int> </value> </member> <member> <name>resultDesc</name> <value>PLSK.10009166.0000 has been successfully created. Following additional keys were attached: KAV.10009167.0000, APS.10009168.0000, KAV.10009169.0000.</value> </member> <member> <name>updateDate</name> <value> <dateTime.iso8601>20121219T00:00:00</dateTime.iso8601> </value> </member> </struct> </value> </param> </params> </methodResponse>'); $element = $response->params->param->value->struct->member[3]->value->array->data[0]; var_dump(each($element));
Output for 5.0.0 - 5.6.25, 7.0.0 - 7.1.0
array(4) { [1]=> array(3) { [0]=> string(17) "KAV.10009167.0000" [1]=> string(17) "APS.10009168.0000" [2]=> string(17) "KAV.10009169.0000" } ["value"]=> array(3) { [0]=> string(17) "KAV.10009167.0000" [1]=> string(17) "APS.10009168.0000" [2]=> string(17) "KAV.10009169.0000" } [0]=> string(5) "value" ["key"]=> string(5) "value" }
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: expecting an array in /in/D0QST on line 57 NULL
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/D0QST on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/D0QST on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/D0QST on line 2