PHP syntax, what does '=>' mean other than array assignment? [duplicate]
Possible Duplicates:
What does “=>” mean in PHP? Reference - What does this symbol mean in PHP?
Check this:
var $hasAndBelongsToMany => array('Member' => 'User');
What does the sign =>
mean? the second one I know, but what is the first =>
?
I saw it in the cakePhp manual.
Link add: http://book.cakephp.org/view/1039/Associations-Linking-Models-Together#
It looks like an mistake.
$var assignments are with a singe '=', that '>' shouldn't be there. It produces an parse error.
Honestly, it looks like a typo. I found the CakePHP manual and only find instances of $hasAndBelongsToMany = array(...
, not => array
.
PHP documentation doesn't know such operator in any other than array item assignment context.
So, it is a typo.
精彩评论