Created
July 15, 2015 01:31
-
-
Save pedrochaves/822db2f588da7ee5d882 to your computer and use it in GitHub Desktop.
autoloading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// config.php | |
include_once 'a.class.php'; | |
include_once 'b.class.php'; | |
include_once 'c.class.php'; | |
include_once 'd.class.php'; | |
// index.php | |
include 'config.php'; | |
$a = new A(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function __autoload($classname) | |
{ | |
include_once $classname . '.class.php'; | |
} | |
$a = new A(); | |
$b = new B(); | |
$c = new C($b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment