How many years of experience is needed (on average) for someone to “master” PHP?
What specific projects does he/she need to accomplish in PHP so he/she can consider himself/herself a good PHP programmer?
You can’t say that generally. Of course, there is time needed to grasp concepts, but you can’t really “master” a language, you can be very good at it. There always will be something you didn’t know about, you’ll always have to extend your knowledge. Even how long it takes somebody to be able to write code fast and good isn’t set in stone because everybody learns differently and some people aren’t gifted with the ability to understand code or think in the way it offers them to write good code fast.
In general, a programmer himself should know his weaknesses and improve them. Only you can know where you are good at and where you are bad at, outside oppinion can help but there is no definite list of projects you have to have done to be considered “good”.
Ironically, the best way to “master” php is to learn another programming language, just to get another point of view. Try to make a project or two in python, ruby or groovy. If after that you’ll be able to return to php, you’ll find yourself a much better programmer than before.
10,000 hours or 10 years. Source:
I submit that when you are a good programmer, you will know in which areas you are excellent, in which ones good, and in which ones you are mere average or not even that.
That ability (and a certain humility) comes from experience, insights, learning new techniques, looking beyond just one language or platform from time to time.
Last not least, one of the most fruitful ways of learning where one stands is being active in communities like SO where common tools and techniques of the trade are discussed.