+ 1

About symbol " -> " in php

I don't understand exact meaning of symbol " -> " please anyone help me to clear about it. What is the exact meaning of this symbol in php.

12th Jun 2018, 1:36 AM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
3 Respostas
+ 5
Since PHP uses the dot . as a concatenation operator, it uses the arrow -> where most other languages would use a dot to access a property or method of an object. It’s technically called the “object operator” but most people call it the arrow (or “arrow operator” or, following JavaScript, the “single-arrow operator”).
12th Jun 2018, 4:30 AM
Alexander Sokolov
Alexander Sokolov - avatar
0
Alexander Sokolov damn good explanation.
12th Jun 2018, 6:10 AM
Lexfuturorum
Lexfuturorum - avatar
0
"->:" its actual name is "object operator". In 2008 in an opensource linux meet conducted in Hyderabad we proposed a name as "calls". So that while writing code we can pronounce $class calls object/property etc. For eg, $class->abc() can be pronounced as $class calls abc(). Ever since we are using that name(calls) unofficially.
14th Mar 2024, 9:14 PM
nisa chara
nisa chara - avatar