title: Why PHP "require" behaves like this?
body: <p>Assume that we have a dir called &quot;tests&quot; with two files: Entries.php and IndexTest.php.</p>
  <p>Entries.php is like this:</p>
  <pre><code>&lt;?php
  
  
  $simpleInput = [(...)];
  
  $completeInput = [(...)]
  </code></pre>
  <p>and IndexTest.php is</p>
  <pre><code>&lt;?php
  
  use PHPUnit\Framework\TestCase;
  
  require_once(__DIR__ . '/Entries.php');
  require_once(__DIR__ . '/../code/Index.php');
  
  final class IndexTest extends TestCase
  {
    public function testSimpleInputReturnRigthAnswer(): void
    {
      
      $this-&gt;assertEquals(
        7,
        Index::resolution($simpleInput)
      );
    }
  
    public function testCompleteInputReturnRightAnswer(): void
    {
      $this-&gt;assertEquals(
        68,
        Index::resolution($completeInput)
      );
    }
  }
  </code></pre>
  <p>But when PHPUnit is executed, it is throwed a error: &quot;Undefined variable $simpleInput&quot; and &quot;Undefined variable $completeInput&quot;.</p>
  <p>But the tests run without errors when Entries.php is</p>
  <pre><code>class Input
  {
    public static function useSimpleEntrie()
    {
      return [(...)];
    }
  
    public static function useCompleteEntrie()
    {
      return [(...)]
  </code></pre>
  <p>and IndexTest.php is</p>
  <pre><code>&lt;?php
  
  use PHPUnit\Framework\TestCase;
  
  require_once(__DIR__ . '/Entries.php');
  require_once(__DIR__ . '/../code/Index.php');
  
  final class IndexTest extends TestCase
  {
    public function testSimpleInputReturnRigthAnswer(): void
    {
      
      $this-&gt;assertEquals(
        7,
        Index::resolution(Input::useSimpleEntrie())
      );
    }
  
    public function testCompleteInputReturnRightAnswer(): void
    {
      $this-&gt;assertEquals(
        68,
        Index::resolution(Input::useCompleteEntrie())
      );
    }
  }
  </code></pre>
  <p>Why does the require_once import the class &quot;Input&quot;, but does not import the variables $simpleInput and $completeInput?</p>