imkingdavid/DuplicateFinder — comment on commit 489988f0e831616e3ad8e30e6c5d458435822abe
File: Project.php line 76
By damianb:

tokenization is going to be the most accurate method however - and this sort of utility shouldn't be run through the web in the first place. detecting if the class is commented out via either of the three class methods, or is encapsulated within a string (such as if it's something that is going to be written to a file, and isn't actually declared in-file) is likely to be heavily problematic and lead to the fast-track towards PCRE hell.

there's also the possibility of simply including the entire first set of files, dumping the array of user-declared functions/classes (serialized) to a file, then comparing using something like array_diff or whatever.

http://us3.php.net/manual/en/function.get-defined-constants.php
http://us3.php.net/manual/en/function.get-defined-functions.php
http://us3.php.net/manual/en/function.get-declared-classes.php
http://us3.php.net/manual/en/function.get-declared-interfaces.php
http://us3.php.net/manual/en/function.get-declared-traits.php