title: Preg_match class name from PHP file
body: <p>I have a script that recursively scans a directory pulling out class names from php files, and storing those classes names in an array. This is working nicely even through the rather large Zend Framework library folders.</p>
  
  <p>The issue is that classes that extend other classes are not being included in the array.</p>
  
  <p>Here is my current preg_match:</p>
  
  <pre><code>if (preg_match("/class\s*(\w*)\s*\{/i",strip_comments(file_get_contents($file)),$matches)) $classes[] = $matches[1];
  </code></pre>
  
  <p>I know that the last \s* is not right; there should be something there that can catch "{" or " extends Some_Other_Class {" .</p>