Re: Not autoloading functions

From: Date: Sun, 29 Jan 2017 10:16:59 +0000
Subject: Re: Not autoloading functions
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-98015@lists.php.net to get a copy of this message
"Niklas Keller" wrote in message news:CANUQDCi945M2TDdztY_tUuhdqN1Xj9WjGsL_EqbYqr5F7_Xing@mail.gmail.com...
I'm sorry, it's unacceptable for who? Only for not defined function it would be called. If I call the same function a thousand times, the autoload will be attempted just the first time, and if it doesn't work then the script would die, exactly like classes. Any project I know that uses functions define them one per file, and each file is required one by one.
Our observations are pretty different. I don't know any projects that use one function per file. I usually see a functions.php per namespace. Regards, Niklas
I agree. My framework contains over 100 functions, and the idea of putting each one into a separate file is something that I would never do. The overhead of loading 100 small files is much large that loading 1 large file. Besides, when I am stepping through code with the debugger in my IDE it shows each file of a separate tab, and being forced to jump around from one tab to another would drive me crazy. -- Tony Marston

« previous php.internals (#98015) next »