Re: Allow objects in define()

From: Date: Tue, 15 Jun 2021 07:50:49 +0000
Subject: Re: Allow objects in define()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-114878@lists.php.net to get a copy of this message
On Tue, Jun 15, 2021 at 8:44 AM Claude Pache <claude.pache@gmail.com> wrote:

>
>
>
> Not sure about specific use cases, for me the important aspect here is to
> avoid arbitrary restrictions. For example, define() accepts resources, and
> this is used for some core constants like STDIN, STDOUT, STDERR.
>
>
> Per the documentation [1], defining resource constants is supposed to
> “cause unpredictable behavio[u]r” and is “not recommended”. Is this correct
> or just FUD?
>

Well, at least I'm not aware of any "unpredictable behavior" it could
cause. I wouldn't recommend it either -- but that's more because I would
recommend against most uses of define(), not so much resources in
particular.

Regards,
Nikita


Thread (9 messages)

« previous php.internals (#114878) next »