Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * https://stackoverflow.com/questions/5861940/is-there-a-way-to-dynamically-change-the-name-of-the-class-being-autoloaded
- */
- class Gila_Baby {
- public function __construct() {
- echo 'hai';
- }
- }
- function autoload($class_name) {
- $real_class_name = 'Gila_' . $class_name;
- class_alias($real_class_name, $class_name);
- }
- autoload('Baby');
- new Baby(); // output: hai
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement