rfc:function_autoloading4
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
rfc:function_autoloading4 [2024/09/03 21:34] – remove weird line withinboredom | rfc:function_autoloading4 [2024/09/04 19:07] (current) – fix example withinboredom | ||
---|---|---|---|
Line 30: | Line 30: | ||
<?php | <?php | ||
- | spl_autoload_register(function ($function, $type) { | + | spl_autoload_register(function ($function) { |
- | | + | $function_path = dirname(str_replace(' |
- | | + | $file = __DIR__ . '/ |
- | $file = __DIR__ . '/ | + | |
- | | + | |
- | require_once $file; | + | require_once $file; |
- | } | + | |
} | } | ||
}, false, false, SPL_AUTOLOAD_FUNCTION); | }, false, false, SPL_AUTOLOAD_FUNCTION); |
rfc/function_autoloading4.1725399245.txt.gz · Last modified: 2024/09/03 21:34 by withinboredom