PHP array syntax/operator?

When writing the syntax for an associative array in PHP we do the following $a = array('foo' => 'bar'); I am curious of the relationship of the `=>` syntax, or possibly operator. Does this relate to some kind of reference used in the hash table in ZE, or some kind of subsequent right shift or reference used in `C`? I guess I am just wondering the true underlying purpose of this syntax, how it relates to ZE and/or php extensions used to handle arrays, how it possibly relates to the written function in `C` before compiled, or If I just have no idea what I am talking about :)
It's just the key => value operator. It's used in foreach loops as well when you need the keys as well as the values of the array you're looping on. In Javascript, the equivalent would be var a = {foo: 'bar'}.

以上就是PHP array syntax/operator?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏