Re: Variable (Class instantiation) collision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Just to clarify, both packages are instantiating and calling their
>respective classes from the $db var, which is in the global scope.
>Is this correct?

I would say yes to the way you are asking. Take the following two applications. The four respective statements are in each their respective script.

Application A:
<?php
class foo {}
$db = new foo();
$outA = barA();
function barA() { global $db; include("Application B"); }
?>

Application B:
<?php
class bar {}
$db = new bar();
$outB = barB();
function barB() { global $db; }
?>

The bridge project is operating in A and include()'ing the script that is B (as I have not found an API for B). $db in B is colliding with $db in A.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux