#33357 [Opn->Fbk]: require_once randomly fails to include file

From: Date: Wed, 15 Jun 2005 21:13:03 +0000
Subject: #33357 [Opn->Fbk]: require_once randomly fails to include file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80399@lists.php.net to get a copy of this message
ID: 33357 Updated by: tony2001@php.net Reported By: elite at programmer dot net -Status: Open +Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Windows 2003 SP1 PHP Version: 5.0.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-06-15 23:04:10] elite at programmer dot net 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33357&edit=1

« previous php.bugs (#80399) next »