|
From: <php...@li...> - 2007-09-10 22:03:49
|
Why not just include java.inc first? Then, even if it does use variables they you've set, then you'll overwrite the value and it won't be an issue. I can't see any reason why you couldn't do the include at the top of the page. I always put it just after session_start();
--Nathan Shaskin
Compliance Publishing
php...@li... wrote: > -----Original Message-----
> From: php...@li...
> [mailto:php...@li...]
> On Behalf Of php...@li...
> Sent: Montag, 10. September 2007 19:43
> To: php...@li...
> Subject: Re: [Php-java-bridge-users] PLEASE name globally
> visiblevariablesvery unique!
>
> ...
> Other libraries use similar code in their setup. I don't see
> a problem
> 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 = '1.0.0'; // this may also - say - be passed in as
parameter.
...
require_once(
);
...
...
// followed my some other code, that expects to see the
// 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.
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
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.
|