On Fri, Jun 12, 2009 at 8:24 AM, Greg Rundlett (freephile) < g...@freephile.com> wrote:
> Assuming the class definition is in memory b/c the defining file is loaded > (require, include, auto-load), > you can call the method by either: > a) instantiating an object instance of the class and then calling the > method > b) calling the method statically (having no object). > See the manual for an example: > http://us.php.net/manual/en/language.oop5.basic.php > It looks like Michele's original snippet had the method marked as private. That means by definition that the method can only be called from within the class itself -- $this->somePrivateMethod() As for static vs instance methods, I believe the best PHP5 practice is to mark a method as static if you intend to call it statically, ditto for instance methods, i.e., don't make them static. Offhand I forget which transgressions are fatal and which are warnings, but I think the best practice is well established. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness
_______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php