Header files in PHP

From: Date: Thu, 21 Aug 2014 17:20:29 +0000
Subject: Header files in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-323777@lists.php.net to get a copy of this message
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? Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com

« previous php.general (#323777) next »