php-src/ext/reflection/tests/ReflectionMethod_isDeprecated_interface.phpt
Benjamin Eberlei 72c874691b
RFC: Add #[\Deprecated] Attribute (#11293)
see https://wiki.php.net/rfc/deprecated_attribute

Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-07-02 09:44:25 +02:00

29 lines
422 B
PHP

--TEST--
ReflectionMethod::isDeprecated(): Implementing a deprecated interface method.
--FILE--
<?php
interface I {
#[\Deprecated]
function test();
}
class Clazz implements I {
function test() {
}
}
$c = new Clazz();
$c->test();
$r = new ReflectionMethod('I', 'test');
var_dump($r->isDeprecated());
$r = new ReflectionMethod('Clazz', 'test');
var_dump($r->isDeprecated());
?>
--EXPECTF--
bool(true)
bool(false)