What’s the difference between -> and :: in php?

Asked

Viewed 46 times

0

I believe the two can be used normally to access a property or a method of an object in php, right? And in the case of Pdo constants it needs to be :: even? cannot be ->? Because I use by default -> on objects.

  • Yeah! It really does have a lot of related questions on the site. And HERE is the reference in the documentation.

  • kkk must be half dumb but reading the meaning of each separate one I don’t know the difference. And after all I can use -> in the Pdo constants or not?

  • Depends Vinicius. You have to read what the people went up there. It can and cannot be used. It depends on whether what you are picking up is static or not.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.