mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
19 lines
677 B
PHP
19 lines
677 B
PHP
--TEST--
|
|
Deprecation promoted to exception should result in fatal error during inheritance
|
|
--FILE--
|
|
<?php
|
|
|
|
set_error_handler(function($code, $message) {
|
|
throw new Exception($message);
|
|
});
|
|
|
|
$class = new class extends DateTime {
|
|
public function getTimezone() {}
|
|
};
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: During inheritance of DateTime: Uncaught Exception: Return type of DateTime@anonymous::getTimezone() should either be compatible with DateTime::getTimezone(): DateTimeZone|false, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): {closure}(8192, 'Return type of ...', '%s', 8)
|
|
#1 {main} in %s on line %d
|