Re: Re: Header files in PHP
| From: | Christoph Michael Becker | Date: | Fri, 22 Aug 2014 11:28:07 +0000 |
| Subject: | Re: Re: Header files in PHP | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323787@lists.php.net to get a copy of this message | ||
Jeffry Killen wrote:
> On Aug 21, 2014, at 6:39 PM, Paul M Foster wrote:
>
>> In PHP, the mechanism used to include code from another file in the
>> current one involves one of four calls:
>>
>> include()
>> include_once()
>> require()
>> require_once()
>>
>> But over the years, I've read many comments about how each of these
>> calls slows down PHP, some more than others. So my question was whether
>> anyone had ever tested this mechanism against the way it's done in C (as
>> above) to determine if one is faster than the others.
>
> As a commentary on this issue, it seems to me that one would have to look
> at the source code that is compiled into the interpreter and see exactly
> what the various include/require statements/functions actually do. With
> out looking at that myself I am guess that the include/require functions
> just establish a hard link to the included script files.
> Just a guess.
FWIW: the relevant source code is in Zend/zend_vm_execute.h line 2670ff[1].
[1] <http://lxr.php.net/xref/PHP_5_5/Zend/zend_vm_execute.h#2670>
--
Christoph M. Becker