summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug48336.phpt
blob: ee90675f0c5d6a8ee113440a2a2cbc8ccee2aad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--TEST--
Bug #48286 (ReflectionProperty::getDeclaringClass() does not work with redeclared properties)
--FILE--
<?php
class A {
}

class B extends A {
  static protected $prop;
}

class C extends B {
  static protected $prop;
}

class D extends C {
}

class E extends D {
}

class F extends E {
  static protected $prop;
}

$class = 'A';
for($class = 'A'; $class <= 'F'; $class ++) {
  print($class.' => ');
  try {
    $rp = new ReflectionProperty($class, 'prop');
    print($rp->getDeclaringClass()->getName());
  } catch(Exception $e) {
    print('N/A');
  }
  print("\n");
}
?>
--EXPECT--
A => N/A
B => B
C => C
D => C
E => C
F => F