Does the order of class definition matter in PHP?

后端 未结 6 710
余生分开走
余生分开走 2020-11-30 07:21

If I have several classes in different php files that I\'m including into a single file, and some of these classes have dependencies on other classes, does the order in whic

6条回答
  •  一整个雨季
    2020-11-30 08:27

    If they all are in the same file, no the order shouldn't matter. There are some rare instances (I've seen with namespaces) where the order does matter, but don't worry about that too much unless you're pushing the envelope.

    Try it. The worst that can happen is that it'll give you an error...

提交回复
热议问题