Re: [Concept] Flip relative function lookup order (global,then local)
| From: | Christoph M. Becker | Date: | Fri, 23 Aug 2024 12:13:44 +0000 |
| Subject: | Re: [Concept] Flip relative function lookup order (global,then local) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125129@lists.php.net to get a copy of this message | ||
On 23.08.2024 at 13:52, Mike Schinkel wrote:
> In theory it would be nice to open up PHP to allow overriding core functions, but that could
> also open a Pandora's box, the kind that makes Ruby code so fragile. At least in Go you have to
> omit the standard lib import and use your own import to override a standard library package.
>
> So in practice PHP may never change to allow core functions to be overridden and thus pining
> for that to block this idea would be a missed opportunity. (That said, PHP could allow a userland
> function to be "registered" to be called instead of the core function, and if that were
> allowed then Nick's proposal would cause no problems. Of course I doubt internals would ever
> bless that idea.)
There are already PECL extensions which allow to do this, e.g.
* <https://pecl.php.net/runkit7>
* <https://pecl.php.net/package/uopz>
And I'd leave it at this.
Christoph