Man Page: reflectionclass.newinstanceargs
Operating Environment: php
Section: 3
REFLECTIONCLASS.NEWINSTANCEARGS(3) 1 REFLECTIONCLASS.NEWINSTANCEARGS(3) ReflectionClass::newInstanceArgs - Creates a new class instance from given arguments.SYNOPSISpublic object ReflectionClass::newInstanceArgs ([array $args])DESCRIPTIONCreates a new instance of the class, the given arguments are passed to the class constructor.PARAMETERSo $args - The parameters to be passed to the class constructor as an array.RETURN VALUESReturns a new instance of the class.EXAMPLESExample #1 Basic usage of ReflectionClass::newInstanceArgs <?php $class = new ReflectionClass('ReflectionFunction'); $instance = $class->newInstanceArgs(array('substr')); var_dump($instance); ?> The above example will output: object(ReflectionFunction)#2 (1) { ["name"]=> string(6) "substr" }ERRORS/EXCEPTIONS A ReflectionException if the class constructor is not public. A ReflectionException if the class does not have a constructor and the $args parameter contains one or more parameters.SEE ALSOReflectionClass::newInstance, ReflectionClass::newInstanceWithoutConstructor. PHP Documentation Group REFLECTIONCLASS.NEWINSTANCEARGS(3)
| Related Man Pages |
|---|
| mail::spf::base(3) - suse |
| reflectionclass(3) - php |
| get_class(3) - php |
| reflectionmethod(3) - php |
| reflectionclass.newinstanceargs(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| Array Printing Inline |
| Link array to class java |
| Store args passed in array but not the first 2 args |
| Javascript constructor "this reference" |