Reply to Re: php classes calling functions using :: and ->

Your name:

Reply:


Posted by peter on 03/23/07 15:38

>I can call a class using "->", but it complains about the ::
> I see on the net where :: is used. Is there a good explanation on when
> to use one over the other or the differences?
>
> $help = new help();
> $help->foo();
> $help::foo();
>
>
> class help{
>
> function foo(){
> echo "test";
> }
> }
>

:: is used to call class methods or properties when the class has not been
initiated:-

http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

[Back to original 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

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