@dheerajjoshim
The only difference, really, is in the spelling.
Both serve to provide a string representation of the object, and both need to be implemented specifically for an object to provide an accurate representation.
(Otherwise you just get a generic "object" string, or nothing at all)
But you should keep in mind that PHP and Java are two extremely different languages, and things may not be implemented the same way between the two, if they are implemented at all.