Jump to content

Speed issue


Ravani

Recommended Posts

Hi everyone,

 

I was discussing this topic with one of my friends and both of us can't give a real answer to this.

 

Example:

class test {
    function a(){
      $obj = new DB_TableObject();
      
      //blabla bla
      
      $this->b($obj);
   }

   function b($object){
      $object->getResults();
   }
}

 

class test {
   function a(){
      $obj = new DB_TableObject();

      //blabla bla

      $this->b($obj);
   }

   function b(){
      $obj = new DB_TableObject();
      $object->getResults();
   }
}

 

Which one is better? The first or the second solution?

Link to comment
https://forums.phpfreaks.com/topic/226458-speed-issue/
Share on other sites

You're right, however I'm getting this error:

 

Fatal error: Declaration of LoginController::__construct() must be compatible with that of Zend_Controller_Action_Interface::__construct() in

 

Seems like I need to add some arguments in the constructor but I don't really know which one.

Link to comment
https://forums.phpfreaks.com/topic/226458-speed-issue/#findComment-1168954
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.