downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ReflectionProperty::getDocComment> <ReflectionProperty::export
[edit] Last updated: Fri, 17 May 2013

view this page in

ReflectionProperty::getDeclaringClass

(PHP 5)

ReflectionProperty::getDeclaringClassRécupère la classe déclarante

Description

public ReflectionClass ReflectionProperty::getDeclaringClass ( void )

Récupère la classe déclarante.

Avertissement

Cette fonction n'est pas documentée et seule la liste des arguments est disponible.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Un objet ReflectionClass.

Voir aussi



add a note add a note User Contributed Notes ReflectionProperty::getDeclaringClass - [1 notes]
up
0
metamarkers at gmail dot com
3 days ago
If you're reflecting an object and get the declaring class of a property that's set but wasn't declared in any class, it returns the class of the instance.

<?php

class X {
   
}

$x = new X();
$x->foo = 'bar';
$reflection = new ReflectionObject($x);
echo
$reflection->getProperty('foo')->getDeclaringClass()->getName(); // X

?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites