3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function guzzle_json_decode($json, $assoc = false, $depth = 512, $options = 0) { $data = \json_decode($json, $assoc, $depth, $options); if (JSON_ERROR_NONE !== json_last_error()) { throw new \InvalidArgumentException( 'json_decode error: ' . json_last_error_msg() ); } return $data; } $json = json_encode(""); var_dump($json); var_dump(guzzle_json_decode("\"\"", true)); var_dump(json_last_error());
based on bLjC3
Output for 5.6.38 - 7.3.0rc3
string(2) """" string(0) "" int(0)