title: Why composer uses other PHP version then php command points to?
body: <p>Here's my environment configuration (Ubuntu). </p>
  
  <p>I have installed PHP 5.5.9 version via apt-get, and using PHPBrew also installed version 7.0.6. The PHP7 version is turned on.</p>
  
  <pre><code>$ which php
  /home/username/.phpbrew/php/php-7.0.6/bin/php
  
  $ php -v
  PHP 7.0.6 (cli) (built: May 12 2016 08:54:46) ( NTS )
  Copyright (c) 1997-2016 The PHP Group
  Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
      with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
  </code></pre>
  
  <p>I have composer installed globally by putting it in proper directory:</p>
  
  <pre><code>$ which composer
  /usr/local/bin/composer
  </code></pre>
  
  <p>Now, when I run <code>composer require &lt;something&gt;</code>, it uses PHP 5.5.9 and returns error like (when the package being installed requires it of course):</p>
  
  <pre><code>Problem 1
    - This package requires php &gt;=5.6.0 but your PHP version (5.5.9) does not satisfy that requirement.
  </code></pre>
  
  <p>Why doesn't composer use PHP version proper for current CLI configuration?</p>
  
  <p>Please note that my question is <strong>why</strong> it happens and not <strong>how</strong> to solve the problem, because I've found already a few workarounds for that. I want to understand what happens here.</p>