Should hardcoded data in a function be static?
<p>When I have hardcoded data in a function I could just initialize the variable normally:</p>

<pre><code>function check_country() {
  $countries = array(
    'aa',
    'ab',
    'ae',
    ...
  );

}
</code></pre>

<p>Will PHP just make <code>$countries</code> <em>point</em> to the literal data in memory or will it <em>copy over</em> all the initialization data to a new ZVAL or whatever?</p>

<p>If it does the latter that would be basically equivalent to this, wouldn't it?</p>

<pre><code>function check_country() {
  $countries = array();
  $countries[] = 'aa';
  $countries[] = 'ab';
  $countries[] = 'ae';

}
</code></pre>

<p>An alternative would be to make the variable static and initialize it like this:</p>

<pre><code>function check_country() {
  static $countries;

  if (!isset($countries))
  {
    $countries = array(
      'aa',
      'ab',
      'ae',
      ...
    );
  }

}
</code></pre>

<p>Is this technique a) faster and does it b) require twice the memory?</p>
