You are here: Re: What is diffrent betwenn :: and -> « PHP Programming Language « IT news, forums, messages
Re: What is diffrent betwenn :: and ->

Posted by Hero Wanders on 07/13/05 04:24

Hello!

> $Graph =& Image_Graph::factory('graph', array(400, 300));
> $Font =& $Graph->addNew('ttf_font', 'Gothic');
>
> I slice some of the code... so I do not really understand what is :: is
> mean and function adn ->

ClassName::staticMethod()
calls the *static* method "staticMethod" in ClassName.
:: is the operator the access static methods.
Static methods can be called without having an object of the concerning
class. Therefore static methods (actually a function a class) may not
use "$this".

$object->method() calls the method "method" of the object referenced by
"$object". Non-static methods work with the state of the object they
belong to.

If you still do not know the difference between static and non-static
methods you should consult some OOP-explaining websites or books.

HTH
Hero Wanders

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация