<?php class Box { public $value; } $box = new Box(); class Test { public function __construct() { global $box; var_dump($box->value = $this); } function __destruct() { global $box; unset($box->value); } } new Test(); new Test();
You have javascript disabled. You will not be able to edit any code.