A
A
AStek2011-08-07 20:56:38
PHP
AStek, 2011-08-07 20:56:38

Problem with php 5?

Greetings colleagues.
In the course of my work, I had a difficult situation regarding which I would like to ask for advice.
In php 5.3 it was possible to execute code like this:

&lt;?php<br/>
 class c1{<br/>
 public static function f1(){<br/>
 //Do some<br/>
 }<br/>
 }<br/>
 $class='c1';<br/>
 $func = 'f1';<br/>
<br/>
$c1::$f1();<br/>
?&gt;<br/>

I need to do this trick with php version 5.2.
Please tell me how to do this or where to at least dig?
UPD
I want to try to do without eval().

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2011-08-07
@WNeZRoS

call_user_func(array($class, $func));

B
bruteo, 2011-08-07
@bruteo

call_user_func($c1 .'::'.$f1);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question