Why php array inital assign syntax, is different from later assign?

后端 未结 0 1514
伪装坚强ぢ
伪装坚强ぢ 2020-12-18 18:50

Example:

$fruits = [\'first\' => \'apple\'];

$fruits = [];
$fruits[\'first\'] = \'apple\';

Why is not allowed initialize like this?

<
相关标签:
回答
  • 消灭零回复
提交回复
热议问题