[php-src] Issue #7957: Shutdown functions are not called when exit is called from output handler

From: Date: Mon, 17 Jan 2022 12:26:15 +0000
Subject: [php-src] Issue #7957: Shutdown functions are not called when exit is called from output handler
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239066@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7957
Comment Author: mvorisek

> ob_flush causes another call to callback with empty buffer: https://3v4l.org/aYQ92 Technically this is calling exit inside
> shutdown handler.
> 
> > If you call exit() within one registered shutdown function, processing will stop
> > completely and no other registered shutdown functions will be called.
> >
> > [register_shutdown_function](https://www.php.net/manual/en/function.register-shutdown-function.php)

you are correct, thanks!

https://3v4l.org/riNB9 - how can I clean the ob buffer inside
ob_start callback?

my desired output is:
```diff
-xunexpected output: x
+unexpected output: x
 shutting down
```


Thread (1 message)

  • mvorisek
« previous php.bugs (#239066) next »