bug73896.phpt 804 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #73896 (spl_autoload() crashes when calls magic _call())
  3. --FILE--
  4. <?php
  5. class Registrator {
  6. public static function call($callable, array $args) {
  7. return call_user_func_array($callable, [$args]);
  8. }
  9. }
  10. class teLoader {
  11. public function __construct() {
  12. Registrator::call('spl_autoload_register', [$this, 'autoload']);
  13. }
  14. public function __call($method, $args) {
  15. $this->doSomething();
  16. }
  17. protected function autoload($class) {
  18. die("Protected autoload() called!\n");
  19. }
  20. public function doSomething() {
  21. throw new teException();
  22. }
  23. }
  24. $teLoader = new teLoader();
  25. try {
  26. new teChild();
  27. } catch (Throwable $e) {
  28. echo "Exception: ", $e->getMessage() , "\n";
  29. }
  30. ?>
  31. --EXPECT--
  32. Exception: Class "teException" not found