<?php
ob_start();
//simulating a JSON output
?>
{
"date": {
"epoch": "1413043200",
"pretty": "07:00 PM IDT , אוקטובר 11, 2014",
"day": 11,
"month": 10,
"year": 2014,
"yday": 283,
"hour": 19,
"min": "00",
"sec": 0,
"isdst": "1",
"monthname": "אוקטובר",
"monthname_short": "אוק",
"weekday_short": "שבת",
"weekday": "שבת",
"ampm": "PM",
"tz_short": "IDT",
"tz_long": "Asia/Jerusalem"
},
"period": 3,
"high": {
"fahrenheit": "86",
"celsius": "30"
},
"low": {
"fahrenheit": "67",
"celsius": "19"
},
"conditions": "בהיר",
"icon": "clear",
"icon_url": "http://icons.wxug.com/i/c/k/clear.gif",
"skyicon": "",
"pop": 0,
"qpf_allday": {
"in": 0,
"mm": 0
},
"qpf_day": {
"in": 0,
"mm": 0
},
"qpf_night": {
"in": 0,
"mm": 0
},
"snow_allday": {
"in": 0,
"cm": 0
},
"snow_day": {
"in": 0,
"cm": 0
},
"snow_night": {
"in": 0,
"cm": 0
},
"maxwind": {
"mph": 15,
"kph": 24,
"dir": "צ-מע",
"degrees": 326
},
"avewind": {
"mph": 11,
"kph": 18,
"dir": "צ-מע",
"degrees": 326
},
"avehumidity": 57,
"maxhumidity": 0,
"minhumidity": 0
}
<?php
$sJSONBuffer = ob_get_contents();
ob_end_clean();
//$sJSONBuffer = utf8_encode($sJSONBuffer);
$aJSONStruct = json_decode($sJSONBuffer, true);
var_dump($aJSONStruct);
//print($sJSONBuffer);
//echo 'errore '.json_last_error().''."\n";
switch (json_last_error()) {
case JSON_ERROR_NONE:
echo ' - No errors';
break;
case JSON_ERROR_DEPTH:
echo ' - Maximum stack depth exceeded';
break;
case JSON_ERROR_STATE_MISMATCH:
echo ' - Underflow or the modes mismatch';
break;
case JSON_ERROR_CTRL_CHAR:
echo ' - Unexpected control character found';
break;
case JSON_ERROR_SYNTAX:
echo ' - Syntax error, malformed JSON';
break;
case JSON_ERROR_UTF8:
echo ' - Malformed UTF-8 characters, possibly incorrectly encoded';
break;
default:
echo ' - Unknown error';
break;
}
echo 'errore '.json_last_error_msg().''."\n";
?>
- Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- array(20) {
["date"]=>
array(17) {
["epoch"]=>
string(10) "1413043200"
["pretty"]=>
string(38) "07:00 PM IDT , אוקטובר 11, 2014"
["day"]=>
int(11)
["month"]=>
int(10)
["year"]=>
int(2014)
["yday"]=>
int(283)
["hour"]=>
int(19)
["min"]=>
string(2) "00"
["sec"]=>
int(0)
["isdst"]=>
string(1) "1"
["monthname"]=>
string(14) "אוקטובר"
["monthname_short"]=>
string(6) "אוק"
["weekday_short"]=>
string(6) "שבת"
["weekday"]=>
string(6) "שבת"
["ampm"]=>
string(2) "PM"
["tz_short"]=>
string(3) "IDT"
["tz_long"]=>
string(14) "Asia/Jerusalem"
}
["period"]=>
int(3)
["high"]=>
array(2) {
["fahrenheit"]=>
string(2) "86"
["celsius"]=>
string(2) "30"
}
["low"]=>
array(2) {
["fahrenheit"]=>
string(2) "67"
["celsius"]=>
string(2) "19"
}
["conditions"]=>
string(8) "בהיר"
["icon"]=>
string(5) "clear"
["icon_url"]=>
string(37) "http://icons.wxug.com/i/c/k/clear.gif"
["skyicon"]=>
string(0) ""
["pop"]=>
int(0)
["qpf_allday"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["qpf_day"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["qpf_night"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["snow_allday"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["snow_day"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["snow_night"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["maxwind"]=>
array(4) {
["mph"]=>
int(15)
["kph"]=>
int(24)
["dir"]=>
string(7) "צ-מע"
["degrees"]=>
int(326)
}
["avewind"]=>
array(4) {
["mph"]=>
int(11)
["kph"]=>
int(18)
["dir"]=>
string(7) "צ-מע"
["degrees"]=>
int(326)
}
["avehumidity"]=>
int(57)
["maxhumidity"]=>
int(0)
["minhumidity"]=>
int(0)
}
- No errorserrore No error
- Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45
- array(20) {
["date"]=>
array(17) {
["epoch"]=>
string(10) "1413043200"
["pretty"]=>
string(38) "07:00 PM IDT , אוקטובר 11, 2014"
["day"]=>
int(11)
["month"]=>
int(10)
["year"]=>
int(2014)
["yday"]=>
int(283)
["hour"]=>
int(19)
["min"]=>
string(2) "00"
["sec"]=>
int(0)
["isdst"]=>
string(1) "1"
["monthname"]=>
string(14) "אוקטובר"
["monthname_short"]=>
string(6) "אוק"
["weekday_short"]=>
string(6) "שבת"
["weekday"]=>
string(6) "שבת"
["ampm"]=>
string(2) "PM"
["tz_short"]=>
string(3) "IDT"
["tz_long"]=>
string(14) "Asia/Jerusalem"
}
["period"]=>
int(3)
["high"]=>
array(2) {
["fahrenheit"]=>
string(2) "86"
["celsius"]=>
string(2) "30"
}
["low"]=>
array(2) {
["fahrenheit"]=>
string(2) "67"
["celsius"]=>
string(2) "19"
}
["conditions"]=>
string(8) "בהיר"
["icon"]=>
string(5) "clear"
["icon_url"]=>
string(37) "http://icons.wxug.com/i/c/k/clear.gif"
["skyicon"]=>
string(0) ""
["pop"]=>
int(0)
["qpf_allday"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["qpf_day"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["qpf_night"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["snow_allday"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["snow_day"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["snow_night"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["maxwind"]=>
array(4) {
["mph"]=>
int(15)
["kph"]=>
int(24)
["dir"]=>
string(7) "צ-מע"
["degrees"]=>
int(326)
}
["avewind"]=>
array(4) {
["mph"]=>
int(11)
["kph"]=>
int(18)
["dir"]=>
string(7) "צ-מע"
["degrees"]=>
int(326)
}
["avehumidity"]=>
int(57)
["maxhumidity"]=>
int(0)
["minhumidity"]=>
int(0)
}
- No errors
Fatal error: Call to undefined function json_last_error_msg() in /in/bflnC on line 113
Process exited with code 255. - Output for 5.2.0 - 5.2.17
- array(20) {
["date"]=>
array(17) {
["epoch"]=>
string(10) "1413043200"
["pretty"]=>
string(38) "07:00 PM IDT , אוקטובר 11, 2014"
["day"]=>
int(11)
["month"]=>
int(10)
["year"]=>
int(2014)
["yday"]=>
int(283)
["hour"]=>
int(19)
["min"]=>
string(2) "00"
["sec"]=>
int(0)
["isdst"]=>
string(1) "1"
["monthname"]=>
string(14) "אוקטובר"
["monthname_short"]=>
string(6) "אוק"
["weekday_short"]=>
string(6) "שבת"
["weekday"]=>
string(6) "שבת"
["ampm"]=>
string(2) "PM"
["tz_short"]=>
string(3) "IDT"
["tz_long"]=>
string(14) "Asia/Jerusalem"
}
["period"]=>
int(3)
["high"]=>
array(2) {
["fahrenheit"]=>
string(2) "86"
["celsius"]=>
string(2) "30"
}
["low"]=>
array(2) {
["fahrenheit"]=>
string(2) "67"
["celsius"]=>
string(2) "19"
}
["conditions"]=>
string(8) "בהיר"
["icon"]=>
string(5) "clear"
["icon_url"]=>
string(37) "http://icons.wxug.com/i/c/k/clear.gif"
["skyicon"]=>
string(0) ""
["pop"]=>
int(0)
["qpf_allday"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["qpf_day"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["qpf_night"]=>
array(2) {
["in"]=>
int(0)
["mm"]=>
int(0)
}
["snow_allday"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["snow_day"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["snow_night"]=>
array(2) {
["in"]=>
int(0)
["cm"]=>
int(0)
}
["maxwind"]=>
array(4) {
["mph"]=>
int(15)
["kph"]=>
int(24)
["dir"]=>
string(7) "צ-מע"
["degrees"]=>
int(326)
}
["avewind"]=>
array(4) {
["mph"]=>
int(11)
["kph"]=>
int(18)
["dir"]=>
string(7) "צ-מע"
["degrees"]=>
int(326)
}
["avehumidity"]=>
int(57)
["maxhumidity"]=>
int(0)
["minhumidity"]=>
int(0)
}
Fatal error: Call to undefined function json_last_error() in /in/bflnC on line 90
Process exited with code 255. - Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
- Fatal error: Call to undefined function json_decode() in /in/bflnC on line 85
Process exited with code 255. - Output for 4.4.5 - 4.4.9
- Fatal error: Call to undefined function: json_decode() in /in/bflnC on line 85
Process exited with code 255. - Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
- Fatal error: Call to undefined function: json_decode() in /in/bflnC on line 85
Process exited with code 255. - Output for 4.3.0 - 4.3.1
- Fatal error: Call to undefined function: json_decode() in /in/bflnC on line 85
preferences:
363.14 ms | 401 KiB | 459 Q