title: Can't instantiate class in different file PHP
body: <p>I'm trying to instantiate a class which is located in a different file. </p>
  
  <p><strong>File A tries to instantiate the class located in File B:</strong></p>
  
  <pre><code>require_once($CFG-&gt;dirroot . '/mod/assign/submission/example/classes/task/class.php');
  // create the instance
  
  $test = new testing();
  </code></pre>
  
  <p><strong>Here is the class in File B to be instantiated:</strong></p>
  
  <pre><code>&lt;?php
  namespace assignsubmission_example\task;
  
  
  class testing extends \core\task\scheduled_task {      
  public function get_name() {
      // Shown in admin screens
      return 'example';
  }
  
  public function execute() {   
  
      echo "hello";
  
  }                                                                                                                               
  } 
  ?&gt;
  </code></pre>
  
  <p><strong>But I get an error message:</strong></p>
  
  <blockquote>
    <p>Exception - Class 'testing' not found</p>
  </blockquote>
  
  <p>Do you know what could be the issue?</p>