note 22715 added to function.include-once

From: Date: Thu, 27 Jun 2002 12:28:43 +0000
Subject: note 22715 added to function.include-once
Groups: php.notes 
Request: Send a blank email to php-notes+get-32269@lists.php.net to get a copy of this message
As stated in the previous contribution, both 'include_once' and 'require_once' do a case sensitive job on Win32, although the Win32 filesystem itself isn't case sensitive. This may cause you a 'Cannot redeclare class' error when a class definition file gets included twice incorrectly. For example, with a file 'test.class.php' containing: <?php class CTest {} ?> executed by the file 'require.php': <?php require_once 'test.class.php'; require_once 'Test.class.php'; ?> you would receive the error: Cannot redeclare class ctest in Test.class.php on line 2 Tested with PHP v4.2.1 on Windows 2000. -- http://www.php.net/manual/en/function.include-once.php http://master.php.net/manage/user-notes.php?action=edit+22715 http://master.php.net/manage/user-notes.php?action=delete+22715 http://master.php.net/manage/user-notes.php?action=reject+22715

« previous php.notes (#32269) next »