Originally posted by bubblenut
Re small functions:
Just how I was tought to do it. Makes a bit more sense in Java, I'd make all the class variables private and then access is only allowed to them through the relevant function making it imposible to update it accept through the proper means.
For example, a complex number might be described in either Cartesian form (x+iy) or in polar form (rcis(θ)). Enforcing a get/set interface means you can have $cx_num->getX(), $cx_num->getY(), $cx_num->getR(), $cx_num->getTheta() and corresponding set methods without having to expose just which representation is being used internally by the class (maybe one, maybe the other, maybe neither, maybe both either synchronously or asynchronously - it doesn't matter!).
Just as an FYI, PHP will distinguish between the property $object->foo and the method $object->foo(). Saves on using "get" a lot. If you don't mind something of an abuse of power, $object->foo() could get the value of $object->foo, and $object->foo($bar) could set it. Whether that's a good idea or not though is debatable.
Also, with PHP5, you can declare properties to be private, and so can enforce the interface.