Welcome Guest, Not a member yet? Register   Sign In
Tip: Sick of get_instance()?
#13

[eluser]Dam1an[/eluser]
I havn't run any benchmarks on this approach, but if you plan on using this many times in a single helper function, then I would recomend just assigning the CI super object to a variable, as the overhead of making multiple calls would probably impact performance, although I'd imagine it would only make a nticable difference if you did it many, many times.

@Lima: Although the function itself would work in PHP4, the example of doing CI()->something() wouldn't, as method chaining only works in PHP5+


Messages In This Thread
Tip: Sick of get_instance()? - by El Forum - 04-08-2009, 08:23 AM
Tip: Sick of get_instance()? - by El Forum - 04-08-2009, 08:43 AM
Tip: Sick of get_instance()? - by El Forum - 04-08-2009, 08:55 AM
Tip: Sick of get_instance()? - by El Forum - 04-08-2009, 09:14 AM
Tip: Sick of get_instance()? - by El Forum - 04-08-2009, 09:32 AM
Tip: Sick of get_instance()? - by El Forum - 04-08-2009, 09:54 AM
Tip: Sick of get_instance()? - by El Forum - 04-16-2009, 07:56 AM
Tip: Sick of get_instance()? - by El Forum - 04-16-2009, 08:42 AM
Tip: Sick of get_instance()? - by El Forum - 04-16-2009, 08:47 AM
Tip: Sick of get_instance()? - by El Forum - 04-17-2009, 04:53 AM
Tip: Sick of get_instance()? - by El Forum - 04-17-2009, 07:56 PM
Tip: Sick of get_instance()? - by El Forum - 04-17-2009, 11:33 PM
Tip: Sick of get_instance()? - by El Forum - 04-19-2009, 07:04 AM
Tip: Sick of get_instance()? - by El Forum - 04-20-2009, 03:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB