Can you have nested classes in PHP?

前端 未结 3 2045
执念已碎
执念已碎 2021-01-17 13:00

I\'m not talking about inheritance. And I\'m not talking about nested objects. I\'m talking:

System::Web::Templating(...)

kind of

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 13:44

    No.

    However, you could do something like this by returning an instantiated object in getInstance():

    myClass::getInstance()->foo();
    

提交回复
热议问题