$arr = array(); // is this line needed?
$arr[] = 5;
I know it works without the first line, but it's often included in practice.
What is the reason? Is it unsafe without it?
I know you can also do this:
$arr = array(5);
but I'm talking about cases where you need to add items one by one.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…