Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- error_reporting(E_ALL | E_STRICT);
- class Request {
- public function __construct() {
- echo '__construct' . PHP_EOL;
- file_put_contents('log.txt', '__construct' . PHP_EOL, FILE_APPEND);
- }
- public function __destruct() {
- echo '__destruct' . PHP_EOL;
- file_put_contents('log.txt', '__destruct' . PHP_EOL, FILE_APPEND);
- }
- public function shutdown() {
- echo 'shutdown';
- file_put_contents('log.txt', 'shutdown' . PHP_EOL, FILE_APPEND);
- }
- }
- $r = new Request();
- register_shutdown_function(array($r, 'shutdown'));
- while (true) {
- sleep(100);
- }
Add Comment
Please, Sign In to add comment