Jump to content

return $this - what is it returning?


ryanlball@gmail.com

Recommended Posts

Hello!

 

In trying to understand Zend Framework a little better I've been going through some of the core library code.  I've been tracing the general path from Zend_Application.

 

I've noticed several times that a method simply returns 'return $this'.  I've never seen that before.  It's really cool and I'm excited to understand what it means.  Below is one example:

 

found in Zend_Loader_Autoloader

    public function setAutoloaders(array $autoloaders)

    {

        $this->_autoloaders = $autoloaders;

        return $this;

    }

 

I really appreciate this help!

Link to comment
https://forums.phpfreaks.com/topic/182815-return-this-what-is-it-returning/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.