I have a question about PHP syntax.
When defining functions and variables, which convention should I use?
I know they do the same thing in practice but I would like to know which method conforms to best practice standards.
Variables
public $varname = array();
or
public $varname = [];
Methods
public function foo($bar = array()){}
or
public function foo($bar = []){}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…