PHP will load the entire file and consume memory. It will also check the
sintax of the entire file. If your file grows to much it would affect the
speed of showing your pages and if it is very big, you could find the limit
of memory of PHP (8Mb by default).

The Zend engine makes an "on the fly" compilation before executing the
functions (see Zend engine in the manual) so it consumes time.

My recomendation should be to have a set of a few files with the functions
grouped by category or by frecuency of use.

Another inconvenient is that if you make a change in one function and by
mistake have a syntax error, all the scripts that use that included file
will crash until you fix it.

I think it's not a nice solution :(

Sorry,
Gabriel.


"Terence" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Dear List,
>
> I have a library of functions which I was thinking of including all from
one
> file, in a kind of
> heirarchy. That way I can just include the one file in each php page and
> have all the functions
> available to me. (a kind of lazy approach I know)
>
> What I was wondering, if using the apache server, will this kind of
approach
> affect the performance
> of my pages, since obviously all functions won't be used for every page
> (perhaps just a couple).
>
> I know from Java that only the functions that are used in the code are
> included when compiling, but with
> php there's no compilation (i think).
>
> Good, bad or ugly?
>
> Thanks
> Terence

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to