title: PHP OOP - I am trying to output an array which has been loaded into a different class
body: <p>class_1.php</p>
  
  <pre><code>class class_1
  {
      public function __construct()
      {
          require_once $_SERVER['DOCUMENT_ROOT'].'/array.php';
      }
  }
  </code></pre>
  
  <p>class_2.php</p>
  
  <pre><code>class class_2
  {
      static function output_array()
      {
          return $array_NUMBERS;
      }
  }
  </code></pre>
  
  <p>array.php</p>
  
  <pre><code>$array_NUMBERS = array('1', '2', '3');
  </code></pre>
  
  <p>page.php</p>
  
  <pre><code>require_once $_SERVER['DOCUMENT_ROOT'].'/class_1.php';
  
  require_once $_SERVER['DOCUMENT_ROOT'].'/class_2.php';
  
  $obj = new class_1();
  
  $numbers = class_2::output_array();
  
  echo '&lt;pre&gt;';
  print_r($numbers);
  </code></pre>
  
  <p>What am I doing wrong here? Aren't you supposed to use "require_once" within classes?</p>
  
  <p><strong>Problem:</strong> It's not outputting the array values.</p>