PHP passing parameters while creating new object, call_user_func_array for objects
- by Patrick
Hi all,
I would like to dynamically create a PHP object, and parameters would be optional.
For example, instead of doing this:
$test = new Obj($param);
I would like to do something like this (create new ob is fictional):
$test = create_new_obj('Obj', $param);
Is there such function in php? Something similar to call_user_func_array, but for object instead.