Instead of version check add this at beggining of file?
```php
if (!defined('JSON_UNESCAPED_SLASHES')) {
   define('JSON_UNESCAPED_SLASHES', 64);
}

if (!defined('JSON_UNESCAPED_UNICODE')) {
   define('JSON_UNESCAPED_UNICODE', 256);
}