Alex Rivera | Logout

What does "->" or "=>" mean in PHP?

Asked 2012-12-26T07:18:35.313
284

I see these in PHP all the time, but I don't have a clue as to what they actually mean. What does -> do and what does => do?

And I'm not talking about the operators. They're something else, but nobody seems to know...

Edit
Report

1 Answer

54

=> is used in associative array key value assignment. Take a look at Arrays.

-> is used to access an object method or property. Example: $obj->method().

answered 2012-12-26T07:21:43.627

Your Answer