Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function __autoload($className)
- {
- $basePath = './';
- $className = str_replace('\\', '/', $className);
- $className = str_replace('_', '/', $className);
- $file = $basePath . strtolower($className) . '.php';
- if (file_exists($file)) {
- require $file;
- }
- }
- $cup = new Cupboard;
- var_dump($cup->insert('spoon')->insert('knife')->remove('spoon')->insert('plate')->getAll());
- // ['knife', 'plate']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement