I’m using Joomla 2.5.
1st method
JFactory::getSession()->set('mymessage', 'here is some message text');
2nd method
$session = JFactory::getSession();
$session->set('mymessage', 'here is some message text');
I use above methods(1 or 2) in my constructor. So I want to optimize the PHP code since it will be called multiple times during execution. What I want to know is which method is effective and efficient?
Thanks
First is un_named session variable call which will avoid
$sessionneed and initialization apart from that everything is same. therefore first may have some efficiency over space may be in time also.