3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { public $c; public function __construct($c) { $this->c = $c; } public function __destruct() { echo 'B'; error_log('D' . $this->c); } } $b = new B(1); register_shutdown_function(function(){ $b = new B(2); echo 'A';}); ob_start(function($buffer){ $b = new B(3); $buffer .= 'C'; return $buffer;});

preferences:
41.94 ms | 402 KiB | 5 Q