title: "Call to undefined function" when calling a function in custom composer package
body: <p>PHP experts! I'm trying to make my code more modular according to the ways of PHP (using 7.0) and this is my first experiment creating my own combination of namespace + composer package + git repository.</p>
  
  <p>My package directory:</p>
  
  <pre><code>packagedir
  |__src
  |   |__myfunc.php
  |__composer.json
  </code></pre>
  
  <p>myfunc.php:</p>
  
  <pre><code>namespace MyNS\MySubNS;
  function myfunc() { return 1; }
  </code></pre>
  
  <p>packagedir/composer.json:</p>
  
  <pre><code>{
    "name": "myns/mysubns",
    ...
    "autoload": {
      "psr-4": { "MyNS\\MySubNS\\": "src" }
    }
  }
  </code></pre>
  
  <p>All checked into repository <code>packagedir/.git.</code></p>
  
  <p>My project directory after composer install:</p>
  
  <pre><code>public_html
  |__vendor
  |   |__composer
  |   |   |__ [all the usual autoload_* stuff, etc.]
  |   |__myns
  |   |   |__mysubns 
  |   |       |__src
  |   |       |   |__myfunc.php
  |   |       |__composer.json
  |   |__autoload.php
  |__composer.json
  |__composer.lock
  |__index.php
  </code></pre>
  
  <p>public_html/composer.json:</p>
  
  <pre><code>{
    "require": {
      "myns/mysubns": "dev-master"
    },
    "repositories": [
      { "type": "git",
        "url": "file:///path/to/packagedir/.git" }
    ]
  }
  </code></pre>
  
  <p>index.php:</p>
  
  <pre><code>ini_set('display_errors','1');
  require_once 'vendor/autoload.php';
  echo \MyNS\MySubNS\myfunc();
  </code></pre>
  
  <p>It looks like composer installed the package in <code>vendor</code>, and <code>autoload_ps4.php</code> includes:</p>
  
  <pre><code>return array(
      'MyNS\\MySubNS\\' =&gt; array($vendorDir . '/myns/mysubns/src'),
  );
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>( ! ) Fatal error: Uncaught Error: Call to undefined function MyNS\MySubNS\myfunc() in /var/www/public_html/index.php on line 3
  ( ! ) Error: Call to undefined function MyNS\MySubNS\myfunc() in /var/www/public_html/index.php on line 3
  </code></pre>
  
  <p>Can anyone see what I'm doing wrong (aside from the advice that .git repositories are not recommended as a place to get packages)?</p>