Guest User

Untitled

a guest
Jan 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. class TestAutoload
  3. {
  4. protected $foo;
  5.  
  6. public function __construct($foo)
  7. {
  8. $this->foo = $foo;
  9. }
  10.  
  11. public function load()
  12. {
  13. var_dump($this->foo);
  14. return false;
  15. }
  16. }
  17.  
  18. $test1 = new TestAutoload('foo');
  19. $test2 = new TestAutoload('bar');
  20.  
  21. spl_autoload_register(array($test1, 'load'));
  22. spl_autoload_register(array($test2, 'load'));
  23.  
  24. new NonExistingCode();
Add Comment
Please, Sign In to add comment