ID:               36141
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
-Operating System: Irrelevant
+Operating System: *
-PHP Version:      5.1.2
+PHP Version:      5.*
 Assigned To:      helly
 New Comment:

Implemented in HEAD


Previous Comments:
------------------------------------------------------------------------

[2006-01-24 12:19:20] [EMAIL PROTECTED]

Description:
------------
An equivalent to ReflectionMethod::invokeArgs() is missing for creating
new instances of classes through the Reflection API where the class'
constructor requires parameters.

I there propose ReflectionClass::newInstanceArgs($args) in addition to
the existing ReflectionClass::newInstance() method.

Reproduce code:
---------------
<?php
class Sample
{
  public function __construct($a, $b)
  {
    print "$a, $b";
  }
}

$class  = new ReflectionClass('Sample');
$object = $class->newInstanceArgs(array(23, 42));
?>

Expected result:
----------------
23, 42



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36141&edit=1

Reply via email to