3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); //simulating a JSON output ?> { "date": { "epoch": "1412956800", "pretty": "07:00 PM IDT , אוקטובר 10, 2014", "day": 10, "month": 10, "year": 2014, "yday": 282, "hour": 19, "min": "00", "sec": 0, "isdst": "1", "monthname": "אוקטובר", "monthname_short": "אוק", "weekday_short": "שישי", "weekday": "שישי", "ampm": "PM", "tz_short": "IDT", "tz_long": "Asia/Jerusalem" }, "period": 2, "high": { "fahrenheit": "87", "celsius": "31" }, "low": { "fahrenheit": "68", "celsius": "20" }, "conditions": "בהיר", "icon": "clear", "icon_url": "http://icons.wxug.com/i/c/k/clear.gif", "skyicon": "", "pop": 10, "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": 338 }, "avewind": { "mph": 11, "kph": 18, "dir": "צ-צ-מע", "degrees": 338 }, "avehumidity": 55, "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 git.master, git.master_jit, rfc.property-hooks
array(20) { ["date"]=> array(17) { ["epoch"]=> string(10) "1412956800" ["pretty"]=> string(38) "07:00 PM IDT , אוקטובר 10, 2014" ["day"]=> int(10) ["month"]=> int(10) ["year"]=> int(2014) ["yday"]=> int(282) ["hour"]=> int(19) ["min"]=> string(2) "00" ["sec"]=> int(0) ["isdst"]=> string(1) "1" ["monthname"]=> string(14) "אוקטובר" ["monthname_short"]=> string(6) "אוק" ["weekday_short"]=> string(8) "שישי" ["weekday"]=> string(8) "שישי" ["ampm"]=> string(2) "PM" ["tz_short"]=> string(3) "IDT" ["tz_long"]=> string(14) "Asia/Jerusalem" } ["period"]=> int(2) ["high"]=> array(2) { ["fahrenheit"]=> string(2) "87" ["celsius"]=> string(2) "31" } ["low"]=> array(2) { ["fahrenheit"]=> string(2) "68" ["celsius"]=> string(2) "20" } ["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(10) ["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(10) "צ-צ-מע" ["degrees"]=> int(338) } ["avewind"]=> array(4) { ["mph"]=> int(11) ["kph"]=> int(18) ["dir"]=> string(10) "צ-צ-מע" ["degrees"]=> int(338) } ["avehumidity"]=> int(55) ["maxhumidity"]=> int(0) ["minhumidity"]=> int(0) } - No errorserrore No error

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.02 ms | 409 KiB | 8 Q