On Monday, 5 August 2024 at 18:30, Christoph M. Becker <[email protected]> wrote:
> On 05.08.2024 at 18:52, Tim Düsterhus wrote:
>
> > On 8/5/24 14:52, Christoph M. Becker wrote:
> >
> > > Hmm, so far I only had skimmed the RFC and the related discussions, but
> > > now I checked out the suggested implementation[1]. Then I tried to
> > > build with PECL/uopz, and of course that failed because ZEND_EXIT is no
> > > longer there. Okay, quickly drop that usage; build succeeds. Then I ran
> > >
> > > <?php
> > > uopz_set_return("exit", function () {echo "hello";}, true);
> > > exit;
> > > ?>
> > >
> > > And got
> > >
> > > hello
> > >
> > > Previously, no output was echoed. While that seems to be fixable in
> >
> > Frankly from a userland developer PoV this looks entirely correct: If I
> > override the exit()
function, then I expect the exit()
function
> > to
> > be overridden.
>
>
> I should have clarified, that "fixing" means to restore the expected
> behavior of uopz, namely that accidential attempts to override exit with
> uopz_set_return()
were silently ignored, but unless uopz.exit=1
is
> set, or uopz_allow_exit(true)
is called, exit is ignored. Especially
> the latter may be relied upon by tests for legacy code.
>
> Christoph
This sounds like a uopz extension issue that is easily fixed.
I am not sure why we should bend over backwards for extensions that allow to break usual userland
semantics while preventing userland behaviour to be better.
Best regards,
Gina P. Banyard