note 22716 added to function.require-once
| From: | f dot vulto at re-base dot com | Date: | Thu, 27 Jun 2002 12:32:40 +0000 |
| Subject: | note 22716 added to function.require-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32270@lists.php.net to get a copy of this message | ||
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.require-once.php
http://master.php.net/manage/user-notes.php?action=edit+22716
http://master.php.net/manage/user-notes.php?action=delete+22716
http://master.php.net/manage/user-notes.php?action=reject+22716