reflectionclass.newinstanceargs(3) php man page | unix.com

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.

SYNOPSIS
public object ReflectionClass::newInstanceArgs ([array $args])
DESCRIPTION
Creates a new instance of the class, the given arguments are passed to the class constructor.
PARAMETERS
o $args - The parameters to be passed to the class constructor as an array.
RETURN VALUES
Returns a new instance of the class.
EXAMPLES
Example #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 ALSO
ReflectionClass::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 &quot;this reference&quot;