I am learning the source codes of a micro MVC framework (Slim), and confusing about the codes below: (https://github.com/codeguy/Slim/blob/master/Slim/Slim.php line 158)
$this->middleware = array($this);
I’ve never seen the syntax before, and wondering what does array($this) mean.
And at line 1094:
$this->middleware[0]->call();
But I noticed that this Class Slim{} doesn’t implement an ArrayAccess interface, so how can it be accessed by index?
I’ve searched in the PHP manual page (http://www.php.net/manual/en/function.array.php) but found nothing. So I turning to here for help, thanks!
It’s simply creates an array with one object element.