Bug #12600: unexpected behaviour

From: Date: Mon, 06 Aug 2001 15:23:34 +0000
Subject: Bug #12600: unexpected behaviour
Groups: php.dev 
Request: Send a blank email to php-dev+get-62278@lists.php.net to get a copy of this message
From:             tr909@bigfoot.com
Operating system: linux redhat 7.1
PHP version:      4.0.6
PHP Bug Type:     Session related
Bug description:  unexpected behaviour

1. when register_globals is off you have to
SET and READ HTTP_SESSION_VARS this is wrong in the docs or 
at least confusing (example 1 on
http://www.php.net/manual/en/ref.session.php
)

BUG
2. session_register cannot be called from inside another 
funcion (when trying a by reference call this generates a 
call-time reference error on some servers)

 function & sess_reg($x){
 global $HTTP_SESSION_VARS;
   session_register(& $HTTP_SESSION_VARS[$x]);
   $GLOBALS[$x] = & $HTTP_SESSION_VARS[$x];
 }
 //session_start();
 sess_reg("foo");
 echo $foo++;

when using session_register($HTTP_SESSION_VARS[$x]);
the variable is NOT registered. and when used by reference 
(as in example above) generates a "Warning: Call-time 
pass-by-reference has been deprecated - 
argument passed by value;"

Tr909
-- 
Edit bug report at: http://bugs.php.net/?id=12600&edit=1



Thread (4 messages)

« previous php.dev (#62278) next »