Namespace issues

From: Date: Tue, 15 Jun 2004 20:04:07 +0000
Subject: Namespace issues
Groups: php.general 
Request: Send a blank email to php-general+get-188353@lists.php.net to get a copy of this message
Hi, Facts: 1. I have the following four scripts: a.php, b.php, c.php and d.php 2. a.php defines a function named foo. 3. b.php includes c.php 4. c.php defines a function named foo Case I: d.php looks like this: <code> include "b.php"; include "a.php"; </code> This causes a fatal error that says that foo cannot be redeclared. Case II: I change d.php to look like this: <code> include "a.php"; include "b.php"; </code> This does NOT cause the same fatal error. When I called foo from d.php, it called the foo defined in a.php Can anyone explain why a fatal error wasnt caused in Case II? I am using PHP version 4.2.3 Thank you, Shaunak Kashyap

« previous php.general (#188353) next »