Call a constructor from variable arguments with PHP
Posted
by zneak
on Stack Overflow
See other posts from Stack Overflow
or by zneak
Published on 2010-04-14T18:58:46Z
Indexed on
2010/04/14
19:03 UTC
Read the original article
Hit count: 334
Hello guys,
I have a function that takes variadic arguments, that I obtain from func_get_args()
.
This function needs to call a constructor with those arguments. However, I don't know how to do it.
With call_user_func
, you can call functions with an array of arguments, but how would you call a constructor from it? I can't just pass the array of arguments to it; it must believe I've called it "normally".
Thank you!
© Stack Overflow or respective owner