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: Thu, 20 Jun 2013

view this page in

ReflectionProperty::getDeclaringClass

(PHP 5)

ReflectionProperty::getDeclaringClassObtiene la clase en la que se declaró

Descripción

public ReflectionClass ReflectionProperty::getDeclaringClass ( void )

Devuelve la clase en la que se declaró.

Advertencia

Esta función no está documentada actualmente, solamente se encuentra disponible la lista de parámetros.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Objeto de tipo ReflectionClass.

Ver también



add a note add a note User Contributed Notes ReflectionProperty::getDeclaringClass - [1 notes]
up
0
metamarkers at gmail dot com
1 month 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 | sitemap | contact | advertising | mirror sites