How many lines of PHP code is too many for one file?

前端 未结 8 2164
日久生厌
日久生厌 2021-02-20 15:55

I\'m creating a PHP file that does 2 mysql database calls and the rest of the script is if statements for things like file_exists and other simple variables. I have about 2000

8条回答
  •  失恋的感觉
    2021-02-20 16:07

    2000 lines of code in a single file is not exactly bad from a computer point of view but in most situations is probably avoidable, take a look into the MVC design pattern, it'll help you to better organize your code.

    Also, bear in mind that including (a lot of) files will slow down the execution of your code.

提交回复
热议问题