Mam taki kod:
private function autoLoader($class) {
if (!empty($this->includeDirs)) {
foreach ($this->includeDirs as $dir) {
$file = $this->basePath.DS.$dir.DS.$class.'.class.php';
if (file_exists($file)) {
require_once($file);
return true;
}
} trigger_error('Class file not found', E_USER_ERROR);
}
}
Chodzi mi o instrukcję return true. Czy w tym przypadku wychodzi ona z funkcji czy tylko z pętli? Wydaje mi się, że powinno wyjść z funkcji, a mimo to zawsze dociera do trigger_error.