You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecation promoted to exception during inheritance
3
+
--SKIPIF--
4
+
<?php
5
+
if (getenv('SKIP_PRELOAD')) die('skip Error handler not active during preloading');
6
+
?>
7
+
--FILE--
8
+
<?php
9
+
10
+
set_error_handler(function($code, $message) {
11
+
thrownewException($message);
12
+
});
13
+
14
+
try {
15
+
class C extends DateTime {
16
+
publicfunctiongetTimezone() {}
17
+
publicfunctiongetTimestamp() {}
18
+
};
19
+
} catch (Exception$e) {
20
+
printf("%s: %s\n", $e::class, $e->getMessage());
21
+
}
22
+
23
+
var_dump(newC());
24
+
25
+
?>
26
+
--EXPECTF--
27
+
Exception: Return type of C::getTimezone() should either be compatible with DateTime::getTimezone(): DateTimeZone|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
0 commit comments