0

I have class

class a{
     var $test;
}

I have lots of functions in files. Each file having its own function like

File1.php contains function File1(){}

There are 50+ files for function. I want to dynamically add onliy one function at runtime, So that final class structure like this

class a{
var $test;
function File1(){
}
}
4
  • This has already been asked before Commented Jun 1, 2013 at 10:30
  • Yes but in the question, We can extend the function with closure but we cant modify the variables of class with closure defination.. Commented Jun 1, 2013 at 10:33
  • why would you want to do that in the first place? Point being why not just add all the methods you need? Commented Jun 1, 2013 at 10:41
  • also see stackoverflow.com/questions/4535330/… Commented Jun 1, 2013 at 10:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.