Some Java frameworks are not doing that well on all tests. So it is not a fair generalization. As for PHP vs Java , it is not really the point of the discussion , since raw php is doing very well.
A framework is simply a pre-packaged organization of your code. In the case of the mini php frameworks, they provide little more than a router.
I have worked on many projects - those with and without frameworks. I will choose code on a framework any day of the week.