Hi,

I've tried to profile scripts with Zend Profiler (Zend Studio 5.5 Linux
trial on local host + Zend Platform 3.0.2 Linux trial on remote vmware
host) and noticed that script with include() call has higher load time. I
have't found explanation of performance differences between include and
include_once in PHP manual. Maybe somebody could explain it.

sample files
--- test.php ---
<?php
/** profiled file */
include_once('./test2.php');
echo $test;
---

--- test2.php ---
<?php
/** included with include_once() */
$test = 'test';
/** lower load time if include() replaced with include_once() */
include('./test3.php');
---

--- test3.php ---
<?php
/** included with include()*/
---

In real scripts there are not functions in test2.php and test3.php.
test2.php is a configuration file with lots of string and array variables.
test3.php is a second configuration file and usually has only comment
section.

-- 
Tomas

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to