title: Get all documents in a collection in PHP, Firebase
body: <p>In the Cloud Firestore documentation:
  <a href="https://firebase.google.com/docs/firestore/query-data/get-data" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/query-data/get-data</a></p>
  <p>I have copied this example:</p>
  <pre><code>$citiesRef = $db-&gt;collection('cities');
  $citiesRef-&gt;document('SF')-&gt;set([
      'name' =&gt; 'San Francisco',
      'state' =&gt; 'CA',
      'country' =&gt; 'USA',
      'capital' =&gt; false,
      'population' =&gt; 860000
  ]);
  $citiesRef-&gt;document('LA')-&gt;set([
      'name' =&gt; 'Los Angeles',
      'state' =&gt; 'CA',
      'country' =&gt; 'USA',
      'capital' =&gt; false,
      'population' =&gt; 3900000
  ]);
  $citiesRef-&gt;document('DC')-&gt;set([
      'name' =&gt; 'Washington D.C.',
      'state' =&gt; null,
      'country' =&gt; 'USA',
      'capital' =&gt; true,
      'population' =&gt; 680000
  ]);
  $citiesRef-&gt;document('TOK')-&gt;set([
      'name' =&gt; 'Tokyo',
      'state' =&gt; null,
      'country' =&gt; 'Japan',
      'capital' =&gt; true,
      'population' =&gt; 9000000
  ]);
  $citiesRef-&gt;document('BJ')-&gt;set([
      'name' =&gt; 'Beijing',
      'state' =&gt; null,
      'country' =&gt; 'China',
      'capital' =&gt; true,
      'population' =&gt; 21500000
  ]);
  printf('Added example cities data to the cities collection.' . PHP_EOL);
  </code></pre>
  <p>And the request :</p>
  <pre><code>$citiesRef = $db-&gt;collection('cities');
  $query = $citiesRef-&gt;where('capital', '=', true);
  $documents = $query-&gt;documents();
  foreach ($documents as $document) {
      if ($document-&gt;exists()) {
          printf('Document data for document %s:' . PHP_EOL, $document-&gt;id());
          print_r($document-&gt;data());
          printf(PHP_EOL);
      } else {
          printf('Document %s does not exist!' . PHP_EOL, $snapshot-&gt;id());
      }
  }
  </code></pre>
  <p>I can't go to the <code>else</code> block.
  If I change <code>where('capital', '=', true)</code> to <code>where('capital', '=', 'test')</code>, the condition should be false and I enter the <code>else</code> block because the documents no 'does not exist.</p>
  <p>But I have a blank page.
  can someone explain to me?
  Thank you.</p>