|
From: <php...@li...> - 2007-09-10 20:46:59
|
> -----Original Message-----
> From: php...@li...=20
> [mailto:php...@li...]=20
> On Behalf Of php...@li...
> Sent: Montag, 10. September 2007 19:43
> To: php...@li...
> Subject: Re: [Php-java-bridge-users] PLEASE name globally=20
> visiblevariablesvery unique!
>=20
> ...
> Other libraries use similar code in their setup. I don't see=20
> a problem=20
> with this. I don't even understand the problem.
Sigh! My last attempt before giving up hope:
I have code like that roughly looks as follows.
---------------
...
$version =3D '1.0.0'; // this may also - say - be passed in as
parameter.
...
require_once(<php-bridge's Java.inc>);
...
<do somethings with the java-bridge>
...
// followed my some other code, that expects to see the=20
// variable value defined at the begin (or being passed in):
...
read_file('foo_bar_'.$version.'.xyz'); // supposed to read
'foo_bar_1.0.0.xyz'
...
---------------
then this code would now suddenly search for 'foo_bar_5.2.3.xyz'
(which most likely will not exist and hence this method fails), since
the innocently looking require_once(...) has modified the $version
variable during the check for the current php-version.
Why is it so hard to understand, that I simply ask, NOT to use a
variable called "$version"? As we have seen this is a very likely
variable name, may thus already exist and its modification can lead to
unexpected results.=20
I guess your answer will now be: MY code should not use a variable
called "$version", but since this is code that sits in a third party
library that I do not want to modify (since I then would have to
repeat that same modification in each new version) this is not an
option.
Hope I could make myself clear and if not I don't care any more...
Michael
|