Re: How to specify 'friend' visibility in php
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Mon, 28 Jan 2008 22:05:02 -0500
Daniel Klein wrote:
I've got a class that has a couple of methods that can't be 'private' cos
they can be called by other classes in the project, but they should not be
called by user code, so I've had to make them 'public'. In other languages
these methods would have 'friend' visibility.
I suspect there is no 'friend' access modifier since php has no concept of a
'module' or 'assembly' (at least none that I am aware of).
I'm use to coding in dynamic languages where you use the 'honor system'. For
example, in python you indicate this by placing an underscore character in
front of the method/function. You also document the method to indicate your
intentions. So unless there is a similar php convention, I am more than ok
doing it that way.
So my question is: What is the php way of doing this?
Daniel Klein
Daniel,
No formal standard like you're thinking; rather a set of informal standards. The problem is, everyone has their own :-)
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- How to specify 'friend' visibility in php
- From: Daniel Klein
- How to specify 'friend' visibility in php
- Prev by Date: Re: CRUD tool to manage a single table?
- Next by Date: Re: [SQLite] Compiling in PHP statically?
- Previous by thread: Re: How to specify 'friend' visibility in php
- Next by thread: [SQLite] Compiling in PHP statically?
- Index(es):
Relevant Pages
|
|