How to add methods dynamically

后端 未结 8 1346
故里飘歌
故里飘歌 2021-01-01 15:15

I\'m trying to add methods dynamically from external files. Right now I have __call method in my class so when i call the method I want, __call inc

相关标签:
8条回答
  • 2021-01-01 16:08

    You cannot dynamically add methods to a class at runtime, period.*
    PHP simply isn't a very duck-punchable language.

    * Without ugly hacks.

    0 讨论(0)
  • 2021-01-01 16:13

    What you are referring to is called Overloading. Read all about it in the PHP Manual

    0 讨论(0)
提交回复
热议问题