Annotation of embedaddon/php/ext/reflection/tests/ReflectionProperty_getDeclaringClass_variation1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ReflectionProperty::getDeclaringClass() with inherited properties.
! 3: --FILE--
! 4: <?php
! 5:
! 6: class A {
! 7: public $prop;
! 8: }
! 9:
! 10: class B extends A {
! 11: }
! 12:
! 13: $propInfo = new ReflectionProperty('B', 'prop');
! 14: var_dump($propInfo->getDeclaringClass());
! 15:
! 16: echo "Wrong number of params:\n";
! 17: $propInfo->getDeclaringClass(1);
! 18:
! 19: ?>
! 20: --EXPECTF--
! 21: object(ReflectionClass)#%d (1) {
! 22: ["name"]=>
! 23: string(1) "A"
! 24: }
! 25: Wrong number of params:
! 26:
! 27: Warning: ReflectionProperty::getDeclaringClass() expects exactly 0 parameters, 1 given in %s on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>