1--TEST-- 2Bug #74673 (Segfault when cast Reflection object to string with undefined constant) 3--FILE-- 4<?php 5 6set_error_handler(function() { 7 throw new Exception(); 8}); 9 10class A 11{ 12 public function method($test = PHP_SELF + 1) 13 { 14 } 15} 16 17$class = new ReflectionClass('A'); 18 19echo $class; 20?> 21--EXPECTF-- 22Fatal error: Uncaught Exception in %s:%d 23Stack trace: 24#0 [internal function]: {closure}(2, 'Use of undefine...', %s, %d, Array) 25#1 %s(%d): ReflectionClass->__toString() 26#2 {main} 27 thrown in %s on line %d 28