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