php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #34732 register_globals is expected to globalize $_SESSION?
Submitted: 2005-10-04 16:28 UTC Modified: 2005-10-13 14:41 UTC
From: nospam0 at malkusch dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2005-10-04 16:28 UTC] nospam0 at malkusch dot de
Description:
------------
There's a discrepance in the manual:   
   
,--<http://de.php.net/manual/en/ini.core.php#ini.register-globals>--   
| Whether or not to register the EGPCS (Environment, GET,   
| POST, Cookie, Server) variables as global variables.   
`--   
   
,--<http://de.php.net/manual/en/reserved.variables.php>--   
| If the register_globals directive is set, then these    
| variables will also be made available in the global    
| scope of the script; i.e., separate from the $_SESSION    
| and $HTTP_SESSION_VARS arrays.   
`--   
   
It's also interessting how PHP 5.0.5 acts concering this  
issue. When creating a new Session it behaves as it's  
described in  
<http://de.php.net/manual/en/ini.core.php#ini.register-globals>,  
and the content of $_SESSION is inknown in $GLOBALS. But  
when I continue the session there's also the content of  
$_SESSION in $GLOBALS.  

Reproduce code:
---------------
session_start();
$_SESSION['test'] = 'test';

var_dump(ini_get('register_globals'));
var_dump($test);
var_dump($_SESSION['test']);

Actual result:
--------------
,--<new session> 
| string(1) "1" 
| NULL 
| string(4) "test" 
`-- 
 
,--<continued session> 
| string(1) "1" 
| string(4) "test" 
| string(4) "test" 
`-- 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-13 14:41 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"However, if the variable is registered by $_SESSION  then the global variable is available since the next request."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 22:01:33 2025 UTC