Ich habe 2 Variablen:PHP - Call-Klasse wie call_user_func
$class : contains the name of the class
$params : contains the parameters to initialize the class like ["key1" => "value1", "key2" => "value2"]
Und ich möchte eine Klasse wie die Funktion call_user_func() aufzurufen, tun mit Funktionen
dh:
$classObject = call_class($class, $params);
// Do the same that:
$classObject = new $class("value1", "value2");
Ihre Antwort ist richtig, aber die Mark Baker Antwort ist OOP –
@ ClémentLaffitte vereinbart. –