|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-15 23:13 UTC] tony2001@php.net
[2005-06-23 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 03:00:01 2025 UTC |
Description: ------------ When using require_once("file.php") to include "file.php" in multiple files, files which are included in each another on several levels, require_once("file.php") randomly fails to include the file at all. Most of the time it includes it, but sometimes it will just fail and the system will come to a halt since that file is vital. Changing to require("file.php") works, but obviously this would include the file several times. Reproduce code: --------------- inc.php $dsn = 'mssql://user:pass@localhost/database'; $db = DB::connect($dsn); if( PEAR::isError( $db ) ) { die "Database connect failed"; } file1.php: require_once("inc.php"); file2.php require_once("file1.php"); require_once("inc.php"); Expected result: ---------------- inc.php included once every timed Actual result: -------------- inc.php sometimes is not included at all, since the database connection in inc.php is not initialized and $db is NULL