So, if you try to do a nested class like this:
//nestedtest.php class nestedTest{ function test(){ class E extends Exception{} throw n
The second way is not nesting of classes. You just have your both declarations in one file, which is different from your first example. In PHP you can have multiple class declarations in one file it is a organizational decision not a requirement.