title: PHP namespace not finding class in same namespace in same directory - works in dev, not prod
body: <p>I have the following PHP files. It works in dev. They have the same namespace, and same PHP version. When I deploy to Heroku, it gives an error. Do you know why?</p>
  <code>Product.php</code>
  <pre><code>namespace app\models;
  class Product extends \yii\db\ActiveRecord
  public function getEbay()    {
      return $this-&gt;hasOne(Ebay::className(), ['product_id' =&gt; 'id'])-&gt;inverseOf('product'); # line 56
  </code></pre>
  <code>Ebay.php</code>
  <pre><code>namespace app\models;
  class Ebay extends \yii\db\ActiveRecord
  </code></pre>
  <blockquote>
  <p>2015-03-25T02:00:01.003508+00:00 app[web.1]: [25-Mar-2015 02:00:01 UTC] PHP Fatal error:  Class 'app\models\Ebay' not found in /app/models/Product.php on line 56</p>
  </blockquote>
  <pre><code>&gt;heroku run php --version
  Running `php --version` attached to terminal... up, run.5360
  PHP 5.6.6 (cli) (built: Feb 19 2015 10:11:22)
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
      with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
  </code></pre>
  <p>Local:</p>
  <pre><code>$ php --version
  PHP 5.6.6 (cli) (built: Feb 25 2015 13:54:50)
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
  </code></pre>
  <hr />
  <p>Ok I even put the <code>use</code> in the <code>index.php</code> and it still fails.</p>
  <pre><code>C:\Users\Chloe\workspace\project&gt;heroku run cat web/index.php
  Running `cat web/index.php` attached to terminal... up, run.3679
  &lt;?php
  
  // comment out the following two lines when deployed to production
  if ($_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1') {
    defined('YII_DEBUG') or define('YII_DEBUG', true);
    defined('YII_ENV') or define('YII_ENV', 'dev');
  }
  
  require(__DIR__ . '/../vendor/autoload.php');
  require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
  
  $config = require(__DIR__ . '/../config/web.php');
  
  use app\models; Ebay::className();
  (new yii\web\Application($config))-&gt;run();
  
  C:\Users\Chloe\workspace\project&gt;heroku logs
  ...
  2015-03-26T17:10:13.590855+00:00 app[web.1]: [26-Mar-2015 17:10:13 UTC] PHP Fatal error:  Class 'Ebay' not found in /app/web/index.php on line 14
  </code></pre>