mirror of
https://github.com/php/php-src.git
synced 2024-12-13 20:05:26 +08:00
a31f46421d
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.
19 lines
357 B
PHP
19 lines
357 B
PHP
--TEST--
|
|
Bug #70967 (Weird error handling for __toString when Error is thrown)
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
public function __toString() {
|
|
undefined_function();
|
|
}
|
|
}
|
|
|
|
echo (new A);
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Call to undefined function undefined_function() in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): A->__toString()
|
|
#1 {main}
|
|
thrown in %s on line %d
|