Re: empty list removed

[email protected] ("Christoph M. Becker")
Newsgroups php.doc
Message-ID <[email protected]>
Hi!

On 05.07.2021 at 08:48, Karoly Negyesi wrote:

> 3ae0b14dd0 removed the list of empty things.
>
> The documentation now says "A variable is considered empty if it does not
> exist or if its value equals false." Great, and which values do that?
>
> The commit message says: "To avoid duplication, we refer to falsey values
> instead."
>
> If this is a duplicate, we need to link to the list where it exists. If it
> is only a duplicate of scattered information all around and the list
> doesn't exist anywhere, this commit needs to be reverted and "SimpleXML
> objects from empty tags" added to the list. I would vastly prefer this one
> but I am not here to start an edit war. Let's discuss first :)

The documentation (<https://www.php.net/empty>) states:

| Returns false if var exists and has a non-empty, non-zero value, aka
| falsey, see conversion to boolean. Otherwise returns true.

"Conversion to boolean" links to
<https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting>,
and there is a list of values which are consired falsey, including
SimpleXMLElements.

Are we looking at different PHP manuals?

> Also, if those objects are worth a special case then
> https://www.php.net/manual/en/types.comparisons.php needs to be fixed too.
> And yes you can -- kind of -- glean the list of empty things from this page
> but it's a big mental effort.

Might be worth to add SimpleXMLElements there; OTOH, *any* internal
object could behave special in this regard.

Christoph
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.