1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00
Files
archived-php-src/ext/reflection/tests/bug74673.phpt
Nikita Popov a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00

28 lines
506 B
PHP

--TEST--
Bug #74673 (Segfault when cast Reflection object to string with undefined constant)
--FILE--
<?php
set_error_handler(function() {
throw new Exception();
});
class A
{
public function method($test = PHP_SELF + 1)
{
}
}
$class = new ReflectionClass('A');
echo $class;
?>
--EXPECTF--
Fatal error: Uncaught Exception in %s:%d
Stack trace:
#0 [internal function]: {closure}(2, 'Use of undefine...', %s, %d, Array)
#1 %s(%d): ReflectionClass->__toString()
#2 {main}
thrown in %s on line %d