For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > October 2004 > include_once() - always included?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author include_once() - always included?
Aaron DeLoach

2004-10-15, 8:55 pm

Hi All,

Always looking for efficiency, consider the following code:

<?php
function one($arg){
if ($arg == 1){
include_once(...);
do some stuff...
}else{
do some stuff...
}
}
?>

If the above function is called with an argument value of '2', is the
'include_once' file included?

Regards,
Aaron




Andy Hassall

2004-10-16, 3:55 am

On Fri, 15 Oct 2004 17:58:33 -0500, "Aaron DeLoach" <aaron@deloachcorp.com>
wrote:

>Always looking for efficiency, consider the following code:
>
><?php
>function one($arg){
> if ($arg == 1){
> include_once(...);
> do some stuff...
> }else{
> do some stuff...
> }
>}
>?>
>
>If the above function is called with an argument value of '2', is the
>'include_once' file included?


No. (What happened when you tried it?)

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Harrie Verveer

2004-10-19, 8:58 am

ehrm no... please tell me this is a joke :P

Aaron DeLoach wrote:
> Hi All,
>
> Always looking for efficiency, consider the following code:
>
> <?php
> function one($arg){
> if ($arg == 1){
> include_once(...);
> do some stuff...
> }else{
> do some stuff...
> }
> }
> ?>
>
> If the above function is called with an argument value of '2', is the
> 'include_once' file included?
>
> Regards,
> Aaron
>
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com