php 5 classes: public, protected and private
- From: "jopperdepopper" <jobjes@xxxxxxxxx>
- Date: 27 Nov 2006 07:18:18 -0800
Hi,
finally giving php 5 a go, and going over the new approach to classes.
Can someone clarify the public, private and protected to me?
I quote the php manual: "The visibility of a property or method can be
defined by prefixing the declaration with the keywords: public,
protected or private. Public declared items can be accessed
everywhere."
But should I read "...can be accessed everywhere within a given class."
or "...can be accessed by all other classes." ?
Job
.
- Follow-Ups:
- Re: php 5 classes: public, protected and private
- From: Jerry Stuckle
- Re: php 5 classes: public, protected and private
- Prev by Date: Getting directory contests using DIR
- Next by Date: Storing objects in a session PHP 5.2.0
- Previous by thread: Getting directory contests using DIR
- Next by thread: Re: php 5 classes: public, protected and private
- Index(es):