[PHP] PHP Namespace issues
Please bear with me if this is not the correct forum to post this issue. I am experiencing xml namespace errors while trying to use zillow.api with Apache 2.2.8 (Fedora), PHP 5.2.5. Dreamweaver 8 with MM-XSLTransform.class version 0.6.3 is acting as the intermediary to process the zillow.php and zillow.xsl files located at www.bancroftandassociates/xml/. I have a support request open with Adobe, but so far, they are NO help! I figured someone here might have some insight as to just where the problem lies! Bob Novak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Namespace issues
Shaunak Kashyap wrote: 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: include "b.php"; include "a.php"; This causes a fatal error that says that foo cannot be redeclared. Case II: I change d.php to look like this: include "a.php"; include "b.php"; 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 Perhaps you have a function_exists() (or similar) call wrapping the declaration of foo() in c.php? If you're using this same function in multiple files and it's the same funciton, you ought to put it in its own file and require_once() the file in the places where you need it. That way, you don't get this problem. You could also wrap all of the declarations in funciton_exists() calls. -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Namespace issues
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: include "b.php"; include "a.php"; This causes a fatal error that says that foo cannot be redeclared. Case II: I change d.php to look like this: include "a.php"; include "b.php"; 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php