PHP Doku:: The ReflectionClass class - class.reflectionclass.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzVariablen- und typbezogene ErweiterungenReflectionThe ReflectionClass class

Ein Service von Reinhard Neidl - Webprogrammierung.

Reflection

<<Reflection::getModifierNames

ReflectionClass::__clone>>


UnterSeiten:

The ReflectionClass class

Einführung

The ReflectionClass class reports information about a class.

Klassenbeschreibung

ReflectionClass implements Reflector {
/* Konstanten */
const integer ReflectionClass::IS_FINAL = 64 ;
/* Eigenschaften */
public $name ;
/* Methoden */
final private void __clone ( void )
__construct ( mixed $argument )
public static string export ( mixed $argument [, bool $return = false ] )
public mixed getConstant ( string $name )
public array getConstants ( void )
public object getConstructor ( void )
public array getDefaultProperties ( void )
public string getDocComment ( void )
public int getEndLine ( void )
public ReflectionExtension getExtension ( void )
public string getExtensionName ( void )
public string getFileName ( void )
public array getInterfaceNames ( void )
public array getInterfaces ( void )
public object getMethod ( string $name )
public array getMethods ([ string $filter ] )
public int getModifiers ( void )
public string getName ( void )
public string getNamespaceName ( void )
public object getParentClass ( void )
public array getProperties ([ int $filter ] )
public ReflectionProperty getProperty ( string $name )
public string getShortName ( void )
public int getStartLine ( void )
public array getStaticProperties ( void )
public mixed getStaticPropertyValue ( string $name [, string $default ] )
public bool hasConstant ( string $name )
public bool hasMethod ( string $name )
public bool hasProperty ( string $name )
public bool implementsInterface ( string $interface )
public bool inNamespace ( void )
public bool isAbstract ( void )
public bool isFinal ( void )
public bool isInstance ( object $object )
public bool isInstantiable ( void )
public bool isInterface ( void )
public bool isInternal ( void )
public bool isIterateable ( void )
public bool isSubclassOf ( string $class )
public bool isUserDefined ( void )
public object newInstance ( mixed $args [, mixed $... ] )
public object newInstanceArgs ([ array $args ] )
public void setStaticPropertyValue ( string $name , string $value )
public string __toString ( void )
}

Eigenschaften

name

Prop description

Vordefinierte Konstanten

ReflectionClass Node Types

ReflectionClass::IS_IMPLICIT_ABSTRACT

ReflectionClass::IS_EXPLICIT_ABSTRACT

ReflectionClass::IS_FINAL

Inhaltsverzeichnis


2 BenutzerBeiträge:
- Beiträge aktualisieren...
thecelavi at gmail dot com
1.12.2009 1:07
Right:

<?php
use AppCore as Core;
$oReflectionClass = new ReflectionClass('App\Core\Singleton');
?>

Wrong:

<?php
use AppCore as Core;
$oReflectionClass = new ReflectionClass('\App\Core\Singleton');
?>
danbettles at yahoo dot co dot uk
29.03.2009 12:48
To reflect on a namespaced class in PHP 5.3, you must always specify the fully qualified name of the class - even if you've aliased the containing namespace using a "use" statement.

So instead of:

<?php
use App\Core as Core;
$oReflectionClass = new ReflectionClass('Core\Singleton');
?>

You would type:

<?php
use App\Core as Core;
$oReflectionClass = new ReflectionClass('App\Core\Singleton');
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)