title: How to count lines of code in a PHP project?
body: <p>I'd like to count the the lines of code of a PHP-project in a given git repository. Currently I'm using:</p>
  
  <pre><code>git ls-files -- *.php* | xargs wc -l
  </code></pre>
  
  <p>to count the lines of code in all php files.</p>
  
  <p>It would be great to have a step before counting all lines, that skips all empty lines and maybe also lines containing comments (in PHP this in <code>#</code> and <code>//</code> for single line comments and <code>/* */</code> for multiline comments). I guess <code>sed</code> might help, but how to handle multiline comments?</p>