Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下
$array = null; $array['xxx'] = 12; \var_dump($array);
将输出
array (size=1) 'xxx' => int 12
为什么?有什么方法可以让 PHP 将这些报告为错误?
$array['xxx'] = 12;
哪里$array是 null/undefined,上面的赋值会创建数组,相当于:
$array
$array = array('xxx' => 12);