<?php
$app = new Yaf_Application(__DIR__ . "/conf/application.ini");
/* the constructor is private; use getInstance() instead */
$loader = Yaf_Loader::getInstance();
var_dump($loader instanceof Yaf_Loader);
/* instantiating directly raises an Error */
try {
$loader = new Yaf_Loader();
} catch (Error $e) {
echo $e->getMessage(), PHP_EOL;
}
?>
The above example will output
something similar to:
bool(true)
Call to private Yaf_Loader::__construct() from global scope