I don't know whether it is right or wrong when I see something written by others. we know that the method of writing classes in textbooks is to write a class in a file, I can see that many classes are concentrated in a php file in a project written by others. is this good? is it against the will of textbooks,
I found that many of the things written in reality are different from those in textbooks.
It seems that the readers who write textbooks are deliberately ignoring readers!
Reply to discussion (solution)
In reality, it is not recommended that a file contain multiple classes, but sometimes multiple classes are written according to the actual situation, which should be flexibly used according to the situation.
You can use it easily ..
If the class is automatically loaded through _ autoload or spl_autoload, one file of each class is suitable.
Writing the base class and inheritance class in a file helps to load class files
In this way, there is no need to include files everywhere, and it takes time to read files.
Of course, organizing the directory tree based on the inheritance relationship of classes helps to manage and maintain codes.
Especially when namespace is used