ReflectionClass::getConstructor

(PHP 5, PHP 7)

ReflectionClass::getConstructor锟斤拷取锟斤拷墓锟斤拷旌拷锟�

说锟斤拷

public ReflectionClass::getConstructor ( void ) : ReflectionMethod

锟斤拷取锟窖凤拷锟斤拷锟斤拷锟侥癸拷锟届函锟斤拷锟斤拷

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

一锟斤拷 ReflectionMethod 锟斤拷锟襟,凤拷锟斤拷锟斤拷锟斤拷墓锟斤拷旌拷锟斤拷锟斤拷锟斤拷叩锟斤拷嗖伙拷锟斤拷诠锟斤拷旌拷锟绞憋拷锟斤拷锟� NULL锟斤拷

锟斤拷锟斤拷

Example #1 ReflectionClass::getConstructor() 锟侥伙拷锟斤拷锟矫凤拷

<?php
$class 
= new ReflectionClass('ReflectionClass');
$constructor $class->getConstructor();
var_dump($constructor);
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

object(ReflectionMethod)#2 (2) {
  ["name"]=>
  string(11) "__construct"
  ["class"]=>
  string(15) "ReflectionClass"
}

锟轿硷拷