Hi all, 

After a bit of testing, I've noticed, that the $HTTP_SESSION_VARS array 
isn't as global as the manual makes it. The following piece of code should 
produce 2 blank lines and a "click here" link the first time it's loaded. 
When you click on the link, I would expect two lines saying "something", but 
only the second one works. 

-----------------------------------------------------------
<?php

session_start();
session_register("test");
$test = "something";

function foo() {
        print($HTTP_SESSION_VARS["test"] . "<br />\n");
}

foo();
print($HTTP_SESSION_VARS["test"] . "<br />\n");

?>

<a href="<?=$PHP_SELF?>">Click here</a>
-----------------------------------------------------------

I would expect the array $HTTP_SESSION_VARS to be global, and thereby 
available inside the foo() function.

Have I misunderstood something in the manual?

If you think of replying that I should use the "global" declaration please 
give a good argument why. I know it solves my problem, but it is still not 
right according to the manual ;)

/watson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to