今天看到串代码做了个小测试
js中
var aa = [] if (aa){ console.log(aa); }
php中
$aa = []; if (!$aa){ var_dump($aa); }
js中空数组是一个对象,可转型为true;php中空数组则为false。