Can somebody please help me with PHP code parsing. I want to be able to extract class names from PHP code: Examples: class Myclass1 extends Mybaseclass { // match is Myclass1 Mybaseclass class Myclass2 // match is Myclass2 null { class Template extends BaseTemplate implements iTemplate // match is Template BaseTemplate /* class ABC { // not a match public $MyProperty = 1; } */ " class ABC { // not a match public $MyProperty = 1; } " . . . etc Thanks
I have a library of over 100 classes. Some of them are stored 1 class per file other are inside one file(multiple classes in 1 file). I want to find out all the names of these classes and the names of their parent classes without executing the whole library. I also want to exclude commented classes and string inside quotes.