3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = <<< EOF <?xml version="1.0" encoding="ISO-8859-1" ?> <datainfo> <origin>NOAA/NOS/CO-OPS</origin> <disclaimer>Disclaimer: These data are based upon the latest information available as of the date of your request, and may differ from the published tide tables. </disclaimer> <producttype> Annual Tide Prediction </producttype> <stationname>Nonopapa, Niihau Island</stationname> <state>HI</state> <stationid>1610367</stationid> <stationtype>Subordinate</stationtype> <referencedToStationName>HONOLULU</referencedToStationName> <referencedToStationId>1612340</referencedToStationId> <HeightOffsetLow>*0.77</HeightOffsetLow> <HeightOffsetHigh>* 0.77</HeightOffsetHigh> <TimeOffsetLow>-11</TimeOffsetLow> <TimeOffsetHigh>-16</TimeOffsetHigh> <BeginDate>20131231 00:00</BeginDate> <EndDate>20141231 23:59</EndDate> <dataUnits>feet(ft) also in centimeters(cm)</dataUnits> <Timezone>LST</Timezone> <Datum>MLLW</Datum> <IntervalType>High/Low Tide Predictions</IntervalType> <data> <item> <date>2013/12/31</date> <day>Tue</day> <time>03:11 AM</time> <predictions_in_ft>2.0</predictions_in_ft> <predictions_in_cm>61</predictions_in_cm> <highlow>H</highlow> </item> <item> <date>2013/12/31</date> <day>Tue</day> <time>10:21 AM</time> <predictions_in_ft>0.1</predictions_in_ft> <predictions_in_cm>3</predictions_in_cm> <highlow>L</highlow> </item> </data></datainfo> EOF; $b = simplexml_load_string($a); $json = json_encode($b ); $array = json_decode($json,true); // unset undesirables foreach($array as $k -> $v){echo $k;}
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined variable $v in /in/cp8Of on line 51 Fatal error: Uncaught Error: Attempt to assign property "" on null in /in/cp8Of:51 Stack trace: #0 {main} thrown in /in/cp8Of on line 51
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: v in /in/cp8Of on line 51 Warning: Creating default object from empty value in /in/cp8Of on line 51 Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /in/cp8Of:51 Stack trace: #0 {main} thrown in /in/cp8Of on line 51
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Warning: Creating default object from empty value in /in/cp8Of on line 51 Recoverable fatal error: Object of class stdClass could not be converted to string in /in/cp8Of on line 51
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Notice: Undefined variable: v in /in/cp8Of on line 51 Warning: Creating default object from empty value in /in/cp8Of on line 51 Recoverable fatal error: Object of class stdClass could not be converted to string in /in/cp8Of on line 51
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: v in /in/cp8Of on line 51 Warning: Creating default object from empty value in /in/cp8Of on line 51 Fatal error: Uncaught Error: Cannot access empty property in /in/cp8Of:51 Stack trace: #0 {main} thrown in /in/cp8Of on line 51
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.24
Notice: Undefined variable: v in /in/cp8Of on line 51 Warning: Creating default object from empty value in /in/cp8Of on line 51 Fatal error: Cannot access empty property in /in/cp8Of on line 51
Process exited with code 255.
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Notice: Undefined variable: v in /in/cp8Of on line 51 Strict Standards: Creating default object from empty value in /in/cp8Of on line 51 Fatal error: Cannot access empty property in /in/cp8Of on line 51
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1, 5.1.3 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/cp8Of on line 47
Process exited with code 255.
Output for 5.1.2
Fatal error: Call to undefined function json_encode() in /in/cp8Of on line 48
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/cp8Of on line 45
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/cp8Of on line 45
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/cp8Of on line 46
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/cp8Of on line 45

preferences:
273.05 ms | 401 KiB | 396 Q