title: Fatal error: Out of memory (allocated 12582912) (tried to allocate 12582920 bytes)
body: <p>In PHP 5, my program is working, but when I change it to PHP 7 the content of table didn't show. This is the error</p>
  <blockquote>
  <p>Fatal error: Out of memory (allocated 12582912) (tried to allocate
  12582920 bytes) in E:\xampp\htdocs\account\classes\class.user.php on
  line 216</p>
  </blockquote>
  <p>code error</p>
  <pre><code>for ($i=0; ($row = Sql::fetch_array($resource)) !== FALSE; $i++) {
          
                  $users[$i] = new User($row[&quot;userId&quot;], $dealerId);
                  $users[$i]-&gt;populate();
  </code></pre>
  <p>and this is the whole code of <code>getAllUsers()</code></p>
  <pre><code> public static function getAllUsers($dealerId) {
      
      $users = array();
  
  
      $sql_query = &quot;SELECT userId FROM dealer_users WHERE dealerId='&quot;.$dealerId.&quot;' ORDER BY username ASC&quot;;
      $sql_query_1 = &quot;SELECT COUNT(*) FROM dealer_users WHERE dealerId='&quot;.$dealerId.&quot;'&quot;;
  
      self::$lastCount = Sql::fetch_first_row_column($sql_query_1);
  
      $resource = Sql::query($sql_query) or die(mysqli_error($sql_query));
  
      for ($i=0; ($row = Sql::fetch_array($resource)) !== FALSE; $i++) {
  
          $users[$i] = new User($row[&quot;userId&quot;], $dealerId);
          $users[$i]-&gt;populate();
      }
  
  
      Sql::free_result($resource);
  
      return $users;
  }
  </code></pre>