Date: 07/28/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5814 Updated: ODBC connection to Oracle fails"
- Previous message: Theodore: "[PHP-DEV] .phps? no longer?"
- In reply to: Alan: "[PHP-DEV] include_once() return values ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alan wrote:
>
> 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 ?
(FYI: DB::factory() and DB::connect() don't do this anymore.)
But I agree with you, the return value if the file was already included
should be true. This is what I would expect, and it is consistent with
include.
- Stig
-- 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>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5814 Updated: ODBC connection to Oracle fails"
- Previous message: Theodore: "[PHP-DEV] .phps? no longer?"
- In reply to: Alan: "[PHP-DEV] include_once() return values ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

