GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Feb-2008, 00:27
cancer10's Avatar
cancer10 cancer10 is offline
New Member
 
Join Date: Jul 2006
Location: India
Posts: 18
cancer10 is on a distinguished road
Question

PHP OOP Question


Hi,

I am new to PHP oop. I was wondering when and why should we use the following:
  1. Public
  2. Protected
  3. Private
  4. are there any other???

An example would be appreciated.

Thanks
__________________
http://www.igchosting.in - Cheapest Web Hosting
  #2  
Old 05-Feb-2008, 13:30
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: PHP OOP Question


From Practical PHP Programming:
Quote:
There are a number of special keywords you can place before a class, a class function definition, or a class variable to alter the way PHP works with it - here's the full list, along with what each of them does:

* Public: This variable or function can be used from anywhere in the script
* Private: This variable or function can only be used by the object it is part of; it cannot be accessed elsewhere
* Protected: This variable or function can only be used by the object it is part of, or descendents of that class
* Final: This variable or function cannot be overridden in inherited classes
* Abstract: This function or class cannot be used directly - you must inherit from them first
The wiki also gives examples for you.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: PHP question Flavs83 MySQL / PHP Forum 1 15-Jan-2008 20:33
PHP - sizes and generation times cable_guy_67 MySQL / PHP Forum 3 29-Sep-2005 08:26
Question about loading php into tables or css pcxgamer Web Design Forum 6 17-Sep-2005 21:08
Grouping data from MySQL with PHP - Newbie question. giobbi MySQL / PHP Forum 12 27-Feb-2004 00:34
PHP Sessions question JdS MySQL / PHP Forum 2 16-Jul-2002 04:58

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:13.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.