9

Whenenever I'm discussing PHP with colleagues I don't know how to describe the little arrow symbol '->' used for accessing properties and methods in PHP. Does it have a name? Is it called arrow?

David Ball
  • 553
  • 9
  • 19

5 Answers5

6

I mostly call it object access operator.

EDIT: Actually, come to think of it; I usually pronounce it as "dot", since most of us here are more familiar with the dot-notation for accessing objects properties. Since it's clearly not a dot, that's probably not the answer you were looking for.

user254875486
  • 11,190
  • 7
  • 36
  • 65
  • That's actually what I've been calling it so far, because I'm more familliar with JavaScript, which uses a dot – David Ball Feb 02 '12 at 14:26
  • JOKE: We should simply call it "Prince", as it seems to be an unpronounceable identifier with an undefined official name. :) – Julio Marchi Apr 21 '19 at 16:30
3

Chaining operator, read here: http://en.wikipedia.org/wiki/Method_chaining

tim
  • 9,896
  • 20
  • 81
  • 137
1

It's called the object operator (T_OBJECT_OPERATOR).

Details here: Where do we use the object operator "->" in PHP?

Community
  • 1
  • 1
Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176
0

It's called the Arrow Operator

Although it seems to be called the Arrow Operator, I can’t find reference to it other than this page on the php.net web site. Granted, I didn’t search all that long.

This article outlines this.

Sandeep Bansal
  • 6,280
  • 17
  • 84
  • 126
-1

True; it's called the arrow operator:

http://ch2.php.net/manual/en/language.oop5.static.php

ayush
  • 14,350
  • 11
  • 53
  • 100