OOP in PHP: Class-function from a variable?

Posted by Martti Laine on Stack Overflow See other posts from Stack Overflow or by Martti Laine
Published on 2010-04-17T06:07:52Z Indexed on 2010/04/17 6:13 UTC
Read the original article Hit count: 303

Filed under:
|
|

Hello

Is it possible to call functions from class like this:

$class = new class;
$function_name = "do_the_thing";
$req = $class->$function_name();

Something similar solution, this doesn't seem to work?

Martti Laine

© Stack Overflow or respective owner

Related posts about php

Related posts about oop