Java and PHP OOP