1--TEST-- 2Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function). 3--FILE-- 4<?php 5register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");}); 6 7class Bad { 8 public function __toString() { 9 throw new Exception('I CAN DO THIS'); 10 } 11} 12 13$bad = new Bad(); 14echo "$bad"; 15--EXPECTF-- 16Fatal error: Uncaught Exception: I CAN DO THIS in %s:%d 17Stack trace: 18#0 %s(%d): Bad->__toString() 19#1 {main} 20 thrown in %s on line %d 21 22 23!!!shutdown!!! 24