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->value[0]; var_dump(each($element));
Output for 5.0.0 - 5.3.29, 5.5.27 - 5.5.36, 5.6.11 - 5.6.28, 7.0.0 - 7.1.0
array(4) { [1]=> string(17) "KAV.10009167.0000" ["value"]=> string(17) "KAV.10009167.0000" [0]=> int(0) ["key"]=> int(0) }
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: expecting an array in /in/SiZlC on line 57 NULL
Output for 5.4.0 - 5.5.26, 5.6.0 - 5.6.10
bool(false)
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/SiZlC 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/SiZlC 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/SiZlC on line 2