Re: optimal code
| From: | Thies C. Arntzen | Date: | Thu, 05 Jul 2001 11:49:06 +0000 |
| Subject: | Re: optimal code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56295@lists.php.net to get a copy of this message | ||
On Thu, Jul 05, 2001 at 02:29:12PM +0300, Adrian Ciutureanu wrote:
> Is any of the versions below more effective?
>
> /** Version 1 **/
> <?
> if($condition) {
> // some big code
> } else {
> // other big code
> }
> ?>
>
> /** Version 2 **/
> <?
> if($condition) {
> include 'file_with_some _big_code.php';
> } else {
> include 'file_with_other_big_code.php';
> }
> ?>
>
> /** Version 3 **/
> <?
> if($condition) {
> require 'file_with_some _big_code.php';
> } else {
> require 'file_with_other_big_code.php';
> }
> ?>
i'd bet no #2. but to be sure benchmark it.
tc