I have a method which only needs to be executed once in PHP but will be called twice. How do I structure this?
<p>I have a method in PHP which calls a SOAP service, parses some data and returns it.</p>

<p>It will return the same data - it asks how many records in a data object.</p>

<p>I need to call it twice with a pass.</p>

<p>My question is, what is best practice for structuring this in PHP? I've tried to see if the function has been called already.Do I use static variables / functions?</p>

<pre><code>function MinimumRequired() { 
        return $this-&gt;NumberPeopleJoined();
    }   

function NumberPeopleJoined () {
        if (isset($NumberPeople)) {
            Debug::Show($NumberPeople);
        }
        static $NumberPeople;
        $NumberPeople = Surge_Controller::NumberPeopleJoined();
        return $NumberPeople;
    }
</code></pre>

<p>Thanks!</p>
