I meant to post something about this months ago, but I came across it again in back issue of SD Times I was reading while travelling to Europe. Coverity did a study of open source technology using their code analysis tools and demonstrated that the LAMP stack has fewer software defects than open source in general. On average, the LAMP stack had 0.290 defects per thousand of lines of code, compared to nearly twice that across 32 open source projects. MySQL and Perl had the lowest defect rates in the LAMP stack, whereas Python and PHP had higher rates of defects. Last year, Coverity did an analysis of MySQL showing that its defect rate was approximately 1/4th of comparable closed source software.
Interestingly enough, there appeared to be no corelation between size of the code base and the defect rate. Coverity's study was part of a research project for the Department of Homeland Security.