please also note that it's case insensitive. For example whan you have a Bark() class for a dog game the class name Bark is your reference to the noise that a dog makes.
If you want a specifig dog (e.g. a poodle which extends a general Dog pbject) to bark, you could name that method bark(), because that's what you want the dog to do (see the duality between the THING and the COMMAND ? (Bark class and bark() method) ).
So, when you do this:
interface BarkBehaviour
{
public function bark();
}
class Bark implements BarkBehaviour
{
public function bark()
{
echo "\nWoof!";
}
}
the instantiation of the barkBehaviour property of your dog will echo "Woof", because PHP thinks that the bark() method is the constructor for the Bark class, which you did NOT intend that way. In JAVA these things are case sensitive so the Bark classes constructor must be called Bark(), not bark().