Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

I have seen this at a lot of place but have never understood it's meaning or working... for example:

// Registry
$registry = new Registry();

// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);

If someone can elaborate this, I will be very greatful... thanks in advance...

like image 511
mas2040 Avatar asked Apr 11 '26 20:04

mas2040


1 Answers

That calls a method on an instance of a class or accesses a field of an instance of a class. You may find this page useful.

like image 91
icktoofay Avatar answered Apr 13 '26 10:04

icktoofay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!