Re: Re: Static functions
| From: | David Eisenhart | Date: | Sun, 09 Feb 2003 23:50:46 +0000 |
| Subject: | Re: Re: Static functions | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135000@lists.php.net to get a copy of this message | ||
pleasure Leo, happy php'ing !!
"Leo Spalteholz" <leo@spalteholz.ca> wrote in message
news:200302091455.21523.leo@spalteholz.ca...
> ah! thank you very much. Thats exactly what I was looking for.
>
> Leo
>
> On February 9, 2003 01:49 pm, David Eisenhart wrote:
> > yes, you can call a static method on a class by specifying the
> > class name, then 2 colons and finally the function name:
> >
> > classname :: functionname([arg,.....])
> >
> > (of course properties can not be accessed by such methods)
> >
> > David Eisenhart
> >
> >
> >
> > "Leo Spalteholz" <leo@spalteholz.ca> wrote in message
> > news:200302091318.15401.leo@spalteholz.ca...
> >
> > > Hi, I'm a bit of a newbie to PHP, I've done some stuff in
> > > Java/VB/C++ but I'm having a few problems finding info on this
> > > issue.
> > >
> > > Does PHP support something like static functions in Java?
> > >
> > > for example in Java I can write:
> > >
> > > public class someClass {
> > > public static void someMethod() {}
> > > }
> > >
> > > and then in another file:
> > >
> > > import someClass;
> > >
> > > public class anotherClass {
> > > someClass.someMethod()
> > > }
> > >
> > > Is there some way to access methods of a class without creating
> > > an object in PHP?
> > > Right now I just include the file (not using a class) and then
> > > call the function but I would like to have it more seperate.
> > >
> > > Thanks,
> > > Leo
>