-> What does this mean in php? $blabla->blabla [duplicate] - php

This question already has answers here:
Where do we use the object operator "->" in PHP?
(6 answers)
Closed 3 years ago.
$blabla->blab, just wondering what this means something to do with an object going into another?
Sorry for being a bit vague .

The arrow-like symbol has nothing to do with "an object going into another".
The syntax $blabla->blab means a call to attribute $blab in the object $blabla.
The syntax $blabla->blab() means a call to method blab() in the object $blabla.
Please read the Basics in PHP documentations.

Related

PHP syntax - what's this? [duplicate]

This question already has answers here:
Colon after method declaration?
(2 answers)
Closed 4 years ago.
It's almost impossible for me to search for an answer to this as I don't know what this syntax is called.
I have a server running a relatively old version of PHP (5.5.38) and I'm getting parse errors when I run a file that has the following:
public function foo(): array
{
...specifically the : array suffix.
Can anyone tell me what this syntax is called (so I can research further) and which PHP version introduced it?
This was added in PHP 7, they're called return type declarations.
http://php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration

what does $this->variable mean [duplicate]

This question already has answers here:
Reference Guide: What does this symbol mean in PHP? (PHP Syntax)
(24 answers)
Closed 7 years ago.
$this->var
There's a "->" symbol when we call a variable, and i'd like to know what actually does the "->" means. I tried to do some research but the textbook and the internet don't explain this clealy.
Thanks in advance.
PHP has two Object Operator namely -> and ::
-> is used when you are trying to call a method on an Instance and / or access an Instance property.
:: is used when you want to call a static method or call a parent class's version of a method within a child class.

What is the name of this operator: “->" in php? [duplicate]

This question already has answers here:
What is the "->" PHP operator called? [closed]
(15 answers)
Closed 9 years ago.
i am php programmer but i don't know name of this operator
->
this operator use in OOP in php.
for example
$this->get();
It is the object operator (known as T_OBJECT_OPERATOR internally).
The official name is object operator : T_OBJECT_OPERATOR.
Generally called " arrow ".

What does -> mean in the context of this function call? [duplicate]

This question already has answers here:
Reference Guide: What does this symbol mean in PHP? (PHP Syntax)
(24 answers)
What does "->" mean/refer to in PHP? [duplicate]
(12 answers)
Closed 9 years ago.
$title = l(
$comment->subject,
comment_node_url(),
array('fragment' => "comment-$comment->cid")
);
Ok, so $title is the l() function, and from what I'm reading, I am passing the $comment->subject argument to l() - is that correct?
What does $comment->subject mean? I'm looking all over and not understanding what it means. Is it an operator of some sort?
Sorry if this is a simple question - I just can't find the answer anywhere.
It's just an operate that indicates that "subject" is a property of $comment. You can read a bit more on the PHP manual.

What does operator -> mean in PHP? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicates:
What does the PHP syntax $var1->$var2 mean?
Reference - What does this symbol mean in PHP?
I'm looking at a PHP framework's code, and now and then the symbols "->" appear... for example:
$controller->permissionCheck($ret);
What does "->" stand for and what is used for?
In your example, $controller is a PHP object created somewhere, and permissionCheck is a function defined in that object that is being called with the variable $ret being passed to it. Check this: Reference - What does this symbol mean in PHP?.
It's used to address a function or property of a class.
In this case a function of the controller class seems to be called.
Operator -> is for access to the non-static members of $controller object. In your case, the member is the function permissionCheck.

Categories