php__phplib/apps/autoload_magic.php

16 lines
339 B
PHP

<?php
/**
* Demonstrate using autoload_except() to avoid fatals with PSR0/4 autoloaders.
*/
require __DIR__ . '/../misc/psr0.php';
spl_autoload_register('autoload_except');
try {
$x = new Zoo();
}
catch (Exception $e) {
echo "We did not get a fatal when instantiating a nonexistent class.\n";
die($e->getMessage() . PHP_EOL);
}