This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If you're anything like me, you upgraded from PHP 7.x to PHP 8.x and discovered that everywhere you were using | |
// JSON in your code, there were some new deprecation warnings getting in your way. | |
// | |
// So, since I use auto_prepend_file in my php.ini, this was a super easy solution. | |
// My recommendation is to do the same thing. Create an auto_prepend file, and put this snippet in it. | |
// the new function | |
define("decode", "json_decode"); | |
define("encode", "json_encode"); |