autoload_magic.php 339 B

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