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, 01:27
cancer10's Avatar
cancer10 cancer10 is offline
New Member
 
Join Date: Jul 2006
Location: India
Posts: 22
cancer10 is an unknown quantity at this point
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
  #2  
Old 05-Feb-2008, 14:30
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,628
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.
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.
-------------
Common Sense v2.0-Striving to make the world a little bit smarter.
 
 

Recent GIDBlogOnce again, no time for hobbies 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 21:33
PHP - sizes and generation times cable_guy_67 MySQL / PHP Forum 3 29-Sep-2005 09:26
Question about loading php into tables or css pcxgamer Web Design Forum 6 17-Sep-2005 22:08
Grouping data from MySQL with PHP - Newbie question. giobbi MySQL / PHP Forum 12 27-Feb-2004 01:34
PHP Sessions question JdS MySQL / PHP Forum 2 16-Jul-2002 05:58

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

All times are GMT -6. The time now is 16:22.


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