PHP +运算符不能一直工作

时间:2015-11-06 17:15:02

标签: php arrays operators

$var = compact('var1', 'var2') + (object)array(
  'var3' => 'asdf',
  'var4' => 'asdf'
);

不起作用,但为什么它有时会起作用?喜欢

$var = array('var1' => 'asdf', 'var2' => 'asdf') + array('var3' => 'asdf', 'var4' => 'asdf');

0 个答案:

没有答案