I have recently learned of the function error_get_last() and json_last_error(). Going through tutorials, I rarely found information on the functions above.
Will all errors caused by json_encode() or json_decode() not be in error_get_last() already?
Is there a better way to handle errors (and memory leaks) during runtime (just before output)?
I use a buffer to hold all output, use the functions above to check for errors, and output the data if no errors are found.