Hi!

I've recently found one fallacious post in comments to PHP documentation
relevant to working with JSON function json_decode.
Here is link to it:
http://php.net/manual/en/function.json-decode.php#106512

First of all i didn't find any provement that json_decode raises Exception
on failure. Even my tests with PHP version 5.4.6 FreeBSD release showed
there is no Exception raised. So try-catch block is realy unnecessary.

Second, checking if result of json_decode is_object is realy meaningless,
because there can be some primitive type encoded and check will evaluate to
false.

And the last one. WHY TO RETURN RESULT OF TERNARY OPERATOR LIKE THAT "... ?
true : false"!!!!!!!!!!

I think that post REALY confuses everybody, it's helpless.

So I'm asking to delete it without any remorse!

Thanks!

And if I wrote in wrong place it's because i haven't find right one, sorry
for that.

С уважением,
Иванов Сергей Викторович

Reply via email to