Search the Community
Showing results for tags 'call_user_func_array'.
Found 1 result
I just find my self thinking about how php reads arguments in a call, reason for this is what I just got stuck in call_user_func_array(). I'm calling the construct method in one class from this function with some arguments. The problem I face now is that I call the construct method 2 times which is not wanted. $params = array('arg1', 'arg2', 'arg3'); <?phpcall_user_func_array(array(new $_GET['class'], '__construct'), $params);?> This would be great if it worked like the one above but this just sends an array as argument. <?phpnew $_GET['class']($params);?> Any suggestions how to solve this?