php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12771 new_object_array()
Submitted: 2001-08-15 14:13 UTC Modified: 2010-12-17 12:46 UTC
From: ron at dmscontrol dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ron at dmscontrol dot com
New email:
PHP Version: OS:

 

 [2001-08-15 14:13 UTC] ron at dmscontrol dot com
  I was hoping that the dynamic creation of objects could be extended to support it's parameters in an array format like the functions call_user_method_array and call_user_func_array(). This would be great for test suites.
eg

function test_suite_object_test($class, $args) {
	if (!class_exists($class)) error();
	else {
		$obj = new_object_array($class, $args);
		...
		futher tests on the object
		...
	}
}

  This would useful, not having to hard code the constructors parameter
list, with obvious limitations, with something like:

function test_suite_object_test($class, $arg1, $arg2, $arg3, $arg4) {
	if (!class_exists($class)) error();
	else {
		$obj = new $class($arg1, $arg2, $arg3, $arg4);
		...
		futher tests on the object
		...
	}
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-17 12:46 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-12-17 12:46 UTC] jani@php.net
Can be done in userland code, no need for anything special here.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC