Skip to content

Instantly share code, notes, and snippets.

@fivestar
Created May 6, 2010 07:38
Show Gist options
  • Save fivestar/391897 to your computer and use it in GitHub Desktop.
Save fivestar/391897 to your computer and use it in GitHub Desktop.
<?php
class Hoge
{
public function __construct()
{
var_dump(__METHOD__);
register_shutdown_function(array($this, 'shutdown'));
}
public function __destruct()
{
var_dump(__METHOD__);
}
public function shutdown()
{
var_dump(__METHOD__);
}
}
class Fuga extends Hoge
{
public function __construct()
{
parent::__construct();
var_dump(__METHOD__);
throw new Exception();
}
public function __destruct()
{
var_dump(__METHOD__);
parent::__destruct();
}
}
$obj = new Fuga;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment