title: How do you put 3 arrays in memory and then reference them to avoid hitting API calls more then 3 times
body: <p>In my code I have 3 functions basically nested. One calls one which then calls another. Code execution is very slow. I am led to believe because these API calls can contain a lot of data and that they are getting ran more then once it is having an impact on performance. </p>
  
  <p>Code sample as follows:</p>
  
  <pre><code>$data['object'] = 'domain';
      $data['action'] = 'read';
      $data['format'] = 'json'; 
          if($response = $this-&gt;request($data)){
              $obj = json_decode($response,true);
          .......
                  }
          }else{
              return $response;
          }
  </code></pre>
  
  <p>So basically, obj gets all the data. </p>
  
  <p>Can I just create say a private array in some form and then write all my results to it and then run my statements against it instead of calling the API several times?</p>