You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an inherent/global issue with how json_last_error() works. In short, the returned error code can be a false positive. It does not reset after a successful encode or decode call. It changes only when there is a new error code.
At the issue core is the following sequence, which gives unintuitive results:
Both var dumps would return an error code. You can read about the issue source over this thread: php/php-src#10166
While in isolation this works ok, in the integration it becomes unreliable if, in the same call/request, there was another error code thrown (i.e. to check if a string is a json). I'm preparing a PR that uses try-catch to handle the error properly.
The text was updated successfully, but these errors were encountered:
So, the last release introduces more strict JSON syntax check.
There is an inherent/global issue with how json_last_error() works. In short, the returned error code can be a false positive. It does not reset after a successful encode or decode call. It changes only when there is a new error code.
At the issue core is the following sequence, which gives unintuitive results:
Both var dumps would return an error code. You can read about the issue source over this thread: php/php-src#10166
While in isolation this works ok, in the integration it becomes unreliable if, in the same call/request, there was another error code thrown (i.e. to check if a string is a json). I'm preparing a PR that uses try-catch to handle the error properly.
The text was updated successfully, but these errors were encountered: