Answer the question
In order to leave comments, you need to log in
How to access a class function if there is only its key?
Let's say I have
$func = 'namefunction';
class A {
public namefunction(){
echo 1;
}
}
a = new A;
// возможно ли как-то придумать такой способ обращения, или есть что-то на этот счет?
a->[$func](); // a->'namefunction'();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question