Re: return false if error

From: Date: Wed, 19 Mar 2014 01:03:15 +0000
Subject: Re: return false if error
References: 1 2  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969384876@lists.php.net to get a copy of this message
Hi all, On Wed, Mar 19, 2014 at 9:52 AM, Hannes Magnusson < hannes.magnusson@gmail.com> wrote: > I don't know why or when strpos docs got changed to 'mixed', that > definitely is not how it was originally: > http://www.php.net/manual/en/about.prototypes.php > > The docs consistently white-lie with "on failure" return value, for > example; if you pass 10 arguments to strpos() it will not return > false, it will actually return null. > > This is true for ~98% of the documented functions. > We are getting bug reports that function returns NULL for invalid arguments. We might be better to consider change it to FALSE for invalid arguments someday. We should be careful for edge case, though. Documenting almost all return value as mixed would not be a good idea. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.doc (#969384876) next »