Guest User

Untitled

a guest
Jun 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1);
  3. error_reporting(E_ALL | E_STRICT);
  4.  
  5. class Request {
  6.     public function __construct() {
  7.         echo '__construct' . PHP_EOL;
  8.         file_put_contents('log.txt', '__construct' . PHP_EOL, FILE_APPEND);
  9.     }
  10.     public function __destruct() {
  11.         echo '__destruct' . PHP_EOL;
  12.         file_put_contents('log.txt', '__destruct' . PHP_EOL, FILE_APPEND);
  13.     }
  14.     public function shutdown() {
  15.         echo 'shutdown';
  16.         file_put_contents('log.txt', 'shutdown' . PHP_EOL, FILE_APPEND);
  17.     }
  18. }
  19.  
  20.  
  21. $r = new Request();
  22.  
  23. register_shutdown_function(array($r, 'shutdown'));
  24.  
  25. while (true) {
  26.     sleep(100);
  27. }
Add Comment
Please, Sign In to add comment