The advantage / disadvantage between global variables and function parameters in PHP?

后端 未结 6 2044
生来不讨喜
生来不讨喜 2020-11-27 07:00

sorry i\'m a beginner and i can\'t determine how good a question this is, maybe it sounds utterly obvious to some of you.

if our use of these two below is t

6条回答
  •  误落风尘
    2020-11-27 07:46

    Write it to take parameters. Maintainability is far more important than micro-optimization. When you take parameters, the variables can not be modified in unexpected places.

提交回复
热议问题