There’s nothing “wrong” with PHP, but it is intended largely for web-based applications, and I wouldn’t put it in the same category as Java, C/C++, or even Python. If you’re interested in different types of programming (and different types of applications), PHP won’t be able to take you everywhere you’d want to go. It’s a scripting language meant to facilitate presentation of markup (web pages). A full-on programming language is a different, bigger, more complicated beast.
I second those recommending Java. But again, we’re not exactly comparing apples to apples here. To place it in context, the Java equivalent of PHP would be JSP. ASP would be yet another equivalent. They all are based on the same goal: to make web pages more powerful and dynamic than (D)HTML/JavaScript/CSS alone can do.
Python–a powerful scripting language–is also a wonderful thing, and I would say it’s unique in the sense that it’s pushed the paradigm of scripting language further than any other scripting language. It’s also enjoying a lot of support right now. But it’s still not quite in the same class as Java or C/C++. A prime example of the difference would be the ability to design GUIs, windowed applications and such. Java and C++ provide support for doing this as part of the platform, whereas Python must be coupled with other components to achieve this goal.
I taught myself Java; I know others that have done the same. Most people I know came to Java after working extensively in C/C++ for years; in my case, it was the opposite, and I have to say I found C/C++ much more difficult to learn, especially C++. I have to (reluctantly, cuz he’s a smart dude) disagree with ultrafilter that Java and C++ are similar. Perhaps from a distance, in that they cover the same ground in an object-oriented way, but looking at C++ code side-by-side with Java can be quite frustrating for me. Frankly, I find Java to be much more elegant. ::ducks::
That said, Microsoft has seen fit to move beyond C++ to a “friendlier” (read: more Java-like) language, which they call C#. I get the sense that they encourage beginning developers to hop on that train rather than become C++ programmers at this point. And from everything I’ve seen, I’m of the opinion that C# is basically a knockoff of Java, which brings us back to square one.
I say, learn Java first, if for no other reason than the vast amount of free resources available to Java programmers. Download the JDK from Sun, and then go get Eclipse, and you’ll already have a pretty powerful java-based IDE without having spent a cent. Most people start by writing applets, since they can easily be run inside of web pages.
I think understanding how languages truly work is something that can only be learned by working with different languages. If you write a small Java program that you’re happy with, then take a week or two to write the same program in C++, you’ll have learned a lot. If you then try to code up the same functionality using PHP, chances are, you’ll run into limitations that force you to use a different design to accomplish the same goals–also an invaluable lesson.
The water only gets deeper from there, but if you’re like me, you’ll start chiseling out a “rosetta stone” in your mind to keep track of how different programming modalities accomplish similar tasks, and why certain platforms are better suited to certain goals. You’ll start to understand how languages like HTML are really adaptations of languages that preceded them, that they’re not perfectly designed for what they’re being used for; how PHP can be seen as an extension of HTML because it just can’t do everything you’d want.
You could start looking at things like Python and Ruby to get an idea of how the envelope is being pushed right now. And it’s always being pushed. Some of the next generation web interfaces are really opening up some exciting possibilities for what you can do in a web browser–take a look at Laszlo.
Look backwards, too. I recently learned a good deal about assembly language, which, besides giving me a new-found appreciation for how hard the old-timers had it, helped me understand the stack and the fetch-execute cycle–the very nerve center of a computer program. I wouldn’t want to have to write in it, but assembly helped me enormously in being able to visualize how the actual, compiled Java byte-code is executed by the Java Virtual Machine.
It’s a fascinating evolution, and it’s happening right before our eyes. Advancements whose equivalents take years in other disciplines can come together in months for a programming language. And the Open Source community has really dramatically increased the amount of resources available on the net. It’s an exciting time to be in the midst of it, and one can easily understand how in ten years time, the landscape will look a lot different. So I say, don’t just learn the languages; learn how to learn the languages. That’s the skill that will carry you forward.