[PHP-DEV] include_once() return values ? From: Alan (alan <email protected>)
Date: 07/26/00

Hi All,

Question: what would you expect include_once() to return on the second attempt to include the same file?

On the first attempt it behaves like include(), returning the return value of the included file, or the int(1) if there is no return statement in the included file.

At the moment include_once() always returns NULL on the second attempt so defensive coding like this wont work:

if(! <email protected>("$somefile"){
        // handle failled include attempt
}

( note that this example is based on ideas implemented in pear DB::connect() )

Is this intentional (feature request material) or bug report time ?

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>