PHP is old and has gone through many versions.
Comparing PHP to other popular languages
A note to developers of other languages getting into PHP. Not everything that makes a language ugly has to do with the language its self. The further the language is from what is familiar, the more ugly it becomes. So why not make languages more like English script, since we all can read? Remember we tried that with SQL, except in the case of simple queries SQL is a readable nightmare. There is a balance between the readability of a language, the speed at which you can code (short hand), the amount of features a language contains and, if it's interpreted, the speed at which it can be parsed. PHP tries to balance these, for instance the annoying $ that is in front of every variable makes the interpreter able to parse the code faster, but is annoying to type over and over. If you are not familiar with shell scripting and C, PHP will look very ugly indeed, but have patience as you get use to it. Once you get use to it then it's more the aspects of the language that I described above that make the language unpalatable at times.
PHP vs. Java
To me PHP is less readable than Java because PHP is less uniform and also I believe, because there is a much more copious use of non alpha numeric characters. That is to say, it is further away from everyday English script than Java. For example, the use of a dollar sign at the beginning of every variable like $somevariable, clutters the screen, yet it allows for nice features like injecting variables into double quoted strings and makes the interpreter faster (as mentioned above).
echo "this is the result of some variable $somevariable which is a string";
Where as in Java it would be:
println('this is the result of some variable '+somevariable+' which is a string');
The use of these devices increase the speed at which you can code. Clearly, it is one of the reasons you can write code in PHP faster than in Java, except maybe when auto complete is running in Eclipse. So it is always a trade off. Perl was an example of a language that could be coded very quickly, but proved difficult to read other peoples code. As you become more familiar with PHP, it of course becomes more readable, but to a point. Even when you are experienced the various special characters employed _POST, __construct, etc. begin to take their toll. In the end I would say that PHP is ugly, but some languages have to strike a balance between short hand and readability and PHP is some where between Perl and Java. If your company is functioning, bringing in revenue and the most important thing is stability then Java can be a better choice on the basis of its maintainability in comparison with PHP and compile time checking. Though PHP is always making strides to use frameworks to make it more maintainable. If you need to iterate quickly then PHP can be great. In the end, I can't say truly what is good, bad and ugly when it comes to popular languages, it's all about trade offs.
Remember PHP is the most programmed language on the planet at the time of this writing.