PHP Code Comparator - Detect Code Changes


29 May 2009

PHP Code Comparator is a command line script allowing to compare different versions of a library, framework or package. It will detect code changes in terms of class existence or method definitions.

If you ever wanted to have a way to quickly identify what classes have been altered or methods have been changed between two different versions of the same package, PHP Code Comparator will help you achieve that.

Instead of using a diff tool, you can simply use this tool. It will basically parse a folder recursively, detect any defined classes and extract the various methods and parameters. This will then be performed on the second version of your library. Finally, a summary will be displayed showing the differences that have been detected.

This tool will detect if a class has been removed, if new classes have been added, if methods have been removed or added and also if the signature of a method has changed.

Where can I download it ?

You can browse the code and download it from

You can also directly get the source code from the git repository.

git clone git://

You will find more information on the official page : PHP Code Comparator

  • Digg
  • Facebook
  • Mixx
  • Google Bookmarks

Comment Form

Who am I?

My name is Bashar Al-Fallouji, I work as a Enterprise Solutions Architect at Amazon Web Services (Sydney, Australia).

I am particularly interested in Cloud Computing, Web applications, Open Source Development, Software Engineering, Information Architecture, Unit Testing, XP/Agile development, etc.

On this blog, you will find mostly technical articles and thoughts around PHP, OOP, OOD, Unit Testing, etc. I am also sharing a few open source tools and scripts.

  • dipan: Hi Bashar It's really awesome that you wrote this code. IT'll save tones of time of all developer. [...]
  • Bashar: Glad that you liked it ! [...]
  • Angel S. Moreno: well, there goes wasting a couple of hours of development and a couple of days of testing. I owe you [...]
  • Bashar: Thats right, the setSaveFile create a files containing an associative array of classname => filen [...]
  • Loggy: Jim's clarification in particular was pretty useful although I did have to dig down into the tree to [...]