mare70 Posted July 21, 2008 Share Posted July 21, 2008 What does "::" example code: $settings = Dbvars::getSettings(); Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/ Share on other sites More sharing options...
Darklink Posted July 21, 2008 Share Posted July 21, 2008 You mean, "what does :: do/mean?"? It's the same as -> I believe. Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595567 Share on other sites More sharing options...
mare70 Posted July 21, 2008 Author Share Posted July 21, 2008 yes,"what does is do/mean?"? Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595568 Share on other sites More sharing options...
mare70 Posted July 21, 2008 Author Share Posted July 21, 2008 if "::"same like "-> " when i shoud use it. thanks Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595574 Share on other sites More sharing options...
DarkWater Posted July 21, 2008 Share Posted July 21, 2008 It's not the same as ->. It's a scope resolution operator. It's often used to perform a method of a given class in a static context, but it's also used when referring to self::, parent::, etc. For example: class Database { protected $instance; protected function __construct() { //do some stuff } public static function getInstance() { if (!$this->instance) { $this->instance = new self(); } return $this->instance; } } Then you could do: $db = Database::getInstance(); Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595576 Share on other sites More sharing options...
mare70 Posted July 21, 2008 Author Share Posted July 21, 2008 ok,thanks ! do you know for some good tutorial on this subject Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595589 Share on other sites More sharing options...
cooldude832 Posted July 21, 2008 Share Posted July 21, 2008 google.com->php OOP tutorial-> enter-> read Of course if you don't have basic php down OOP isn't much help to you. Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595590 Share on other sites More sharing options...
DarkWater Posted July 21, 2008 Share Posted July 21, 2008 It's used in a computer paradigm called object-oriented programming. There's plenty of books and articles and tutorials on the subject. There are even 3 on this very site on the home page that are pretty well-written. Start with those (starting with number 1, of course). Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595592 Share on other sites More sharing options...
mare70 Posted July 21, 2008 Author Share Posted July 21, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/115849-solved-basic-question-about-operators-quotquot/#findComment-595596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.