richardpon / php_autoloading_experiments

PHP experiments showing spl_autoload_register() and require_once successfully and failing to resolve circular dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To Execute and Generate the Fatal:

php run.php

Three ways to "fix" the fatal

  1. animal.php should not require_once('cat.php'): This commit
  2. Animal class should not extend Creature class: This commit
  3. Instead of using autoloader, explicitly require_once creature.php and animal.php from run.php: This commit

About

PHP experiments showing spl_autoload_register() and require_once successfully and failing to resolve circular dependencies


Languages

Language:PHP 100.0%