On Tue, Dec 11, 2012 at 8:35 AM, Сергей Иванов <skyppp...@gmail.com> wrote: > 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. > > С уважением, > Иванов Сергей Викторович
Is it an ideal solution? No. As you mentioned, there are parts that are pointless. Does that make it an incorrect solution? I'm not sure what our policy is on this type of cleanup. I have deleted a few posts that are point-blank false, but this one just contains "odd" code. -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php