0
 public function run()
{
    spl_autoload_register(array($this, 'loadClass'));
}

Why use $this here? How should spl_autoload_register() be used?

William
  • 942
  • 2
  • 12
  • 25
wispedia
  • 11
  • 2
  • `How to use spl_autoload_register() ?`... Did you try google for it, to find description and examples? – סטנלי גרונן Feb 18 '17 at 13:50
  • yes, but I still don't understand $this, some examples like this are used to call a static function.for example spl_autoload_register(array('className','functionName')).$this is a object or a string? – wispedia Feb 18 '17 at 14:05
  • HTH: http://stackoverflow.com/questions/1523479/what-does-the-variable-this-mean-in-php – סטנלי גרונן Feb 18 '17 at 14:27
  • 1
    Possible duplicate of [someone explain spl\_autoload, \_\_autoload and spl\_autoload\_register?](http://stackoverflow.com/questions/7651509/someone-explain-spl-autoload-autoload-and-spl-autoload-register) – Abhishek Jain Feb 18 '17 at 15:30

0 Answers0