mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00

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>
29 lines
422 B
PHP
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)
|