On Sunday 28 October 2001 22:17, Imar de Vries wrote:
Hi all,
a very frustrating problem. For some reason I am not able to pass on an
array between two functions, although I declare it global in both of
them. I suspect my use of a switch statement to control the flow of the
[...]
switch
Christian Reiniger wrote:
So you want to share the array across *requests*
That doesn't have *anything* to do with global.
Have a look at how HTTP works - each request is an isolated execution of
a PHP script. it doesn't have any idea of what other pages the user
already looked at. To
Hi all,
a very frustrating problem. For some reason I am not able to pass on an
array between two functions, although I declare it global in both of
them. I suspect my use of a switch statement to control the flow of the
functions is causing some trouble, but I'm not sure. Changing the order
in
Hey-
I would think you would need to define $array_test outside in a global
environment rather then inside the function since I think/thought it will
just stay scoped in there and that global was used to access variables
which weren't defined inside a functions scope and make it look
Henrik Hudson wrote:
I would think you would need to define $array_test outside in a global
environment rather then inside the function since I think/thought it will
just stay scoped in there and that global was used to access variables
which weren't defined inside a functions scope and
Well, the switch statement will only run ONE of the functions, never both.
The default runs and then you break out of the switch, also: shouldn't
default be at the bottom of the switch? or is that just convention? Anyways,
there is no way for main() to ever pass anything to test_one(), since
,
=dn
- Original Message -
From: Imar de Vries [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 28 October 2001 21:49
Subject: Re: [PHP] switch-statement overrides use of global arrays?
Henrik Hudson wrote:
I would think you would need to define $array_test outside in a global
Dl Neil wrote:
The global array is being defined in the mainline, but not populated. What happens
if you set element 0 to some
value (to take up some storage space first) and then try the switched function calls?
This did not produce the desired result, unfortunately. The array is filled
8 matches
Mail list logo