(PHP 5, PHP 7, PHP 8)
ReflectionClass::getConstructor — Obtiene el constructor de una clase
Obtiene el constructor de una clase.
Esta función no contiene ningún parámetro.
Un objeto ReflectionMethod que refleja el constructor
de la clase, o null si la clase no tiene constructor.
Ejemplo #1 Uso simple de ReflectionClass::getConstructor()
<?php
$class = new ReflectionClass('ReflectionClass');
$constructor = $class->getConstructor();
var_dump($constructor);
?>El ejemplo anterior mostrará :
object(ReflectionMethod)#2 (2) {
["name"]=>
string(11) "__construct"
["class"]=>
string(15) "ReflectionClass"
}