xref: /php-src/ext/reflection/tests/bug78895.phpt (revision f8d79582)
1--TEST--
2Fixed bug #78895 (Reflection detects abstract non-static class as abstract static).
3--FILE--
4<?php
5abstract class Foo {
6    abstract public function f1();
7}
8interface I {
9    public function f2();
10}
11trait T {
12    abstract public function f2();
13}
14class Bar extends Foo implements I {
15    use T;
16    function f1() {}
17    function f2() {}
18}
19$ref = new ReflectionClass(Foo::class);
20var_dump(Reflection::getModifierNames($ref->getModifiers()));
21$ref = new ReflectionClass(I::class);
22var_dump(Reflection::getModifierNames($ref->getModifiers()));
23$ref = new ReflectionClass(T::class);
24var_dump(Reflection::getModifierNames($ref->getModifiers()));
25$ref = new ReflectionClass(Bar::class);
26var_dump(Reflection::getModifierNames($ref->getModifiers()));
27?>
28--EXPECT--
29array(1) {
30  [0]=>
31  string(8) "abstract"
32}
33array(0) {
34}
35array(0) {
36}
37array(0) {
38}