The crux of the answer depends on whether distribution of the new work includes code from the work you are referencing. It sounds like the GPL is specifically what you're asking about, so we'll stick with that.
Case 1:
If you create a PHP framework and include code licensed under the PHP License in the source code that comprises that framework, then your code would be a derivative work. In the case of PHP source code, that means that you would have to include the PHP license information and identify portions of your source code that are licensed under the PHP license.
If you wrote all of the code within the PHP Framework source you're talking about, you can release it under whatever license you wish. Most PHP Frameworks (from my brief search) appear to be BSD-licensed, but nothing prevents you from creating a GPL-licensed framework of your own.
Case 2:
Wordpress themes are GPL (at least the PHP code is) http://wordpress.org/development/2009/07/themes-are-gpl-too/
Case 3:
Depends on what you're asking. If you're asking if it's okay to create a new class that could be used with an existing framework (and doesn't reference anything in the framework it's meant to be included in), but you are not creating a new version of the framework, including the class, and distributing this modified compilation, then no, that wouldn't be a derivative work.
Even if you did include it, you'd still not have licensing issues until you decided to distribute that version. At that point, you would have a derivative work (since it includes other code), and the license of that existing code would become important in determining whether or not you would be allowed to do so.
It might help a bit to know why the question is being asked, since there are an awful lot of what-ifs involved. You might contact the EFF or SFLC with specific questions about a specific situation.