Re: How to specify 'friend' visibility in php



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
==================

.



Relevant Pages

  • Re: popen on Windows
    ... On Sun, 23 Dec 2007 14:50:59 GMT, Daniel Klein ... I can't see how you are going to capture the output via "popen" which is ... You need to capture the output as a string so ... I created a php script: ...
    (comp.lang.php)
  • Re: Keyboard input using command line PHP under Windows
    ... using command line PHP. ... examples of attempted variations: ... PHP variables must be prepended with a '$'. ... Daniel Klein ...
    (comp.lang.php)