title: Eloquent error using with and select together. Segmentation fault
body: <p>When performing <code>select</code> and <code>with</code> in one query builder there's no server error. I just get the following message: <code>&lt;domain&gt; page isnt working. &lt;domain&gt; didn't send any data.</code></p>
  
  <p>When I check in /var/log/apache2/error.log there is a log of: </p>
  
  <p><code>child pid 1948 exit signal Segmentation fault (11), possible coredump in /etc/apache2</code></p>
  
  <p>I've tried using query scopes as mentioned <a href="https://stackoverflow.com/questions/27702492/laravel-eloquent-with-and-select-conflict-with-each-other">here</a> <strong>eg</strong></p>
  
  <pre><code>$posts = Post::with(['image' =&gt; function($query){
    $query-&gt;select('id');
  }])-&gt;select('id')-&gt;get();
  </code></pre>
  
  <p>If I change <code>get()</code> to <code>toSql()</code> it only outputs <code>select id from posts</code>;</p>
  
  <p>I've also tried removing the <code>select</code> and passing columns to <code>get()</code> with no luck.</p>
  
  <p>Further investigation:</p>
  
  <p>I've tried setting up GDP to debug apache core dumps, but no dumps seem to get created. </p>
  
  <p>I've since setup xdebug and followed the function stack to it's <a href="https://github.com/laravel/framework/blob/5.2/src/Illuminate/Database/Eloquent/Builder.php#L640" rel="nofollow noreferrer">death here at</a> <code>function loadRelation()</code> inside <code>Eloquent\Builder.php</code>.</p>
  
  <p>Prior to this it calls <a href="https://github.com/laravel/framework/blob/5.2/src/Illuminate/Database/Eloquent/Builder.php#L609" rel="nofollow noreferrer">eagerLoadRelations(array $models)</a> and gets all Post models correctly as a collection of posts with only id attributes, yet on the first iteration of of loading the image relation it dies on</p>
  
  <p><code>call_user_func($constraints, $relation);</code></p>
  
  <p>any help or advice would be appreciated.</p>