File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / reflection / tests / bug48336.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>