[sync] First shot at php conversion.

Chuck Hagenbuch chuck at horde.org
Sat Nov 8 18:54:47 PST 2003


Quoting Anthony Mills <amills at gascard.net>:

> BTW Is there a good book or source on how to use classes in PHP?  I've
> been using OOP for years, but I don't see how to do things like static
> functions and overloading.  I make heavy use of it in later code.

The manual at http://www.php.net/manual/ is pretty good - I don't know of
anything besides that off the top of my head. It's not to hard to pick up,
really.

If by overloading you mean having the same function take different numbers of
arguments, you're out of luck on that one. Of course you can change the type of
arguments and of the return value, and you can have defaulted (optional)
arguments, and you can pass arrays, so there's probably an easy way around it.

Static methods are easy - just avoid referencing $this anywhere in the method:

class Static {

    function write($foo)
    {
        echo $foo;
    }

}

Static::write('Hi Anthony');

etc...

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
"I am not that interested in green food." - Average Joe


More information about the sync mailing list