Re: Header files in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2014-08-21 19:20 GMT+02:00 Paul M Foster <paulf@xxxxxxxxxxxxxxxxx>:

> Folks:
>
> Over the years, I've heard a lot of back and forth about require_once,
> require, include, include_once and he like. Most of it centers around
> the CPU time taken to execute these calls.
>
> The "C" way to do something similar is to define a constant in a header
> file and then check for its existence in the C code file. In PHP, this
> would be roughly like this:
>
> LIBRARY FILE:
>
> define('CONST_DATE', TRUE);
>
> CODE FILE:
>
> if (!defined('CONST_DATE'))
>         include('date.lib.php');
>
> Has anyone ever compared execute times to see if something like this
> would be "cheaper" than include/require[_once]? Any thoughts on it?
>

First I'd evaluate, if it's worth it, when you use an opcode cache and an
autoloader. I'd guess there is no measurable (and it's all about
measurement) impact.


>
> Paul
>
> --
> Paul M. Foster
> http://noferblatz.com
> http://quillandmouse.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
github.com/KingCrunch

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux