- spl_autoload_register: documentation ( source)
<?php
function x($class)
{
print "xxx\n"; // gets printed
throw new Exception("Class '{$class}' not found");
}
spl_autoload_register('x');
try {
$a = A::z(); // FATAL ERROR: class 'A' not found
// NOTE:
// $a = A::$z; - will be correctly caught
} catch (Exception $ex) {
print "{$ex}\n"; // never gets executed
}