Re: Return value docs of empty()

From: Date: Tue, 09 Jan 2018 14:18:20 +0000
Subject: Re: Return value docs of empty()
References: 1 2 3  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969386874@lists.php.net to get a copy of this message
On 09.01.2018 at 14:45, Rowan Collins wrote: > On 9 January 2018 13:21:59 GMT+00:00, Peter Cowburn <petercowburn@gmail.com> wrote: > >> On 9 January 2018 at 12:55, Christoph M. Becker <cmbecker69@gmx.de> >> wrote: >> >>> Any objections? >> >> Not from me. The variable-without-a-value is covered by the null case, >> and >> the fact that a variable-without-a-value is null is covered elsewhere. > > I don't know if there are other notes on the page that make it redundant, but the handling > of undefined variables is one of the most important things about empty() - as a language construct, > it has a unique ability to accept them without generating a notice. Already the description states: | A variable is considered empty if it does not exist or […] The parameter section clarifies: | No warning is generated if the variable does not exist. And the return values section begins with: | Returns FALSE if var exists and […] See <http://www.php.net/manual/en/function.empty.php>. In my opinion this is more than sufficient. Furthermore | $var; (a variable declared, but without a value) does not make sense. Neither is $var; a variable declaration (`var $var;` would be a declaration), nor could this statement be passed to empty(). Finally, | The following things are considered to be empty: appears to be rather unspecific for a technical documentation – "things"? -- Christoph M. Becker

« previous php.doc (#969386874) next »