fork download
  1. <?php
  2.  
  3. Class Test {
  4.  
  5. private $no;
  6.  
  7. public function __construct($no) {
  8. $this->no = $no;
  9. }
  10.  
  11. public function shutdownHandler() {
  12. echo $this->no.' called';
  13. }
  14.  
  15. }
  16.  
  17. $test1 = new Test(1);
  18. $test2 = new Test(2);
  19.  
  20. register_shutdown_function(array($test1,'shutdownHandler'));
  21.  
  22.  
  23.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
1 called