note 100660 modified in reflectionclass.hasmethod by danbrown
| From: | danbrown@php.net | Date: | Thu, 28 Oct 2010 16:48:18 +0000 |
| Subject: | note 100660 modified in reflectionclass.hasmethod by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173571@lists.php.net to get a copy of this message | ||
Parent methods (regardless of visibility) are also available to a ReflectionObject. E.g.,
<?php
class ParentObject {
public function parentPublic( ) {
}
private function parentPrivate( ) {
}
}
class ChildObject extends ParentObject {
}
$Instance = new ChildObject();
$Reflector = new ReflectionObject($Instance);
var_dump($Reflector->hasMethod('parentPublic')); // true
var_dump($Reflector->hasMethod('parentPrivate')); // true
?>
--was--
Parent methods (regardless of visibility) are also available to a ReflectionObject. E.g.,
class ParentObject {
public function parentPublic( ) {
}
private function parentPrivate( ) {
}
}
class ChildObject extends ParentObject {
}
$Instance = new ChildObject();
$Reflector = new ReflectionObject($Instance);
var_dump($Reflector->hasMethod('parentPublic')); // true
var_dump($Reflector->hasMethod('parentPrivate')); // true
http://php.net/manual/en/reflectionclass.hasmethod.php