the colon? double colon?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

the colon? double colon?

Post by jmilane »

What does this mean?

Code: Select all

parent::postProcess[);
Is the colon just an OO operator, signifying that this function belongs to the parent object?

What about when it is only a single colon?

Thank you!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The double colon gives static access to methods and properties of a class. The "parent" keyword is how you access methods and properties in an inherited class from within a class.

The single colon is used in several places, such as switch/case statements, alternate control structure syntax and in the ternary conditional operator.
Last edited by Christopher on Tue Aug 22, 2006 6:45 pm, edited 1 time in total.
(#10850)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

It's the Paamayim Nekudotayim

Which is Arabic or Hebrew for Double Double Dot. Or something :P
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

aye, I did my usual of posting guesses then editing post reference :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Jenk wrote:It's the Paamayim Nekudotayim

Which is Arabic or Hebrew for Double Double Dot. Or something :P
"Paamayim Nekudotayim" is actually "Double Colon" in Hebrew :P
Post Reply