1
Hello I am using the following php codes
<?php
namespace lab312\database;
class ScriptFactory
{
function __construct()
{
}
//outras funcionalidades
}
and
<?php
namespace lab312\database\testes;
use lab312\database\ScriptFactory;
/* arquivo t.php*/
$script = new ScriptFactory();
however when I call the Scriptfactory class the following error:
Fatal error: Class 'lab312 database Scriptfactory' not found in t.php on line 17
any hint?
is missing the autoloader. PS: If the downvoter can manifest... is a completely valid doubt.
– gmsantos
Isn’t the fact that "tests" are in the namespace of the second file causing Scriptfactory to be searched within it? Try the following to see if you solve: $script = new lab312 database Scriptfactory();
– Rodrigo Tognin
Opa... missing a include/require from the first file in the second! Already did this?
– Rodrigo Tognin