Welcome Guest, Not a member yet? Register   Sign In
Autoload function
#4

(02-24-2019, 06:23 AM)Skinper Wrote: Hello, I have some doubts about autoload in CodeIgniter.
My first question is that currently, I use __autoload, it has been discontinued? Is not it good practice to use it?
I read about the spl_autoload_register, is it better to use it instead of __autoload?
Also, my other doubt is related to server demand when using autoload, does it load EVERYTHING as soon as the server is loaded or is it on demand?
Because if it loads everything, it would not be good to put many includes there, right?

Thanks a lot ! Blush

You should use spl_autoload_register instead of __autoload. __autoload has been DEPRECATED as of PHP 7.2.0. Relying on this feature is highly discouraged.

The registered autoload function loads only the requested file on demand.
Reply


Messages In This Thread
Autoload function - by Skinper - 02-24-2019, 06:23 AM
RE: Autoload function - by InsiteFX - 02-24-2019, 09:22 AM
RE: Autoload function - by Skinper - 02-24-2019, 02:59 PM
RE: Autoload function - by dave friend - 02-24-2019, 04:01 PM
RE: Autoload function - by Skinper - 02-25-2019, 10:19 AM
RE: Autoload function - by dave friend - 02-25-2019, 05:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB