![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 602 Pomógł: 30 Dołączył: 1.08.2007 Skąd: Nowy Sącz Ostrzeżenie: (0%) ![]() ![]() |
Witam, mam problem, jeśli w nagłówku 1 funkcji podaję 5 argumentów(Singleton::instance('KlasaTest', $arg1, $arg2, $arg3, $arg4, $arg5)(IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) to jak mam przekazać te 5 argumentów($arg[1-5]) do instancji klasy new $class ($args).
Próbowałem zrobić tak
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 22.08.2008 Ostrzeżenie: (0%) ![]() ![]() |
Właśnie miałem o to pytać, a jak to wykonać na nie statycznym konstruktorze?
Próbowałem tak call_user_func_array(new Test, $args); call_user_func_array(array($testInstance', ''), $args); call_user_func_array(array('Test', '__construct'), $args); W tym ostatnim przypadku wyskakuje, że konstruktor nie może być ujemny |
|
|
![]() ![]() |
![]() |
Aktualny czas: 16.10.2025 - 17:12 |