Jump to content

When is :: used ?


colap

Recommended Posts

http://uk3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php

 

It basically allows you to access static functions and const variables in a class without having to create an instance of it.

 

e.g you could go

 

class obj {

  const var = 'test';

}

 

echo obj::var;

Link to comment
https://forums.phpfreaks.com/topic/228794-when-is-used/#findComment-1179603
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.