Key-value 版本兼容警告
如果key不加引号
$data=[ john1=>1.2, 'john2'=>1, ];
将出现key需更正为字串型别警告
Warning: Use of undefined constant john1 - assumed 'john1' (this will throw an Error in a future version of PHP) in 位址 on line 行号
Key-value 其他错误警告
如果在阵列内部误加进tab空格
$data=[ 「Tab」'john1'=>1.2, 「Tab」'john2'=>1, ];
则阵列无法识别
Parse error: syntax error, unexpected ''john1'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in 位址 on line 行号
(补充) Key-value写法
//第1种$data=array( 'john1'=>'1.2', 'john2'=>'1', );//第2种 $data=[ 'john1'=>'1.2', 'john2'=>'1', ];