php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34536 ini_get('register_globals') does not return correct value
Submitted: 2005-09-16 21:31 UTC Modified: 2005-10-01 10:31 UTC
From: leoli at optonline dot net Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.0.5 OS: Windows XP
Private report: No CVE-ID: None
 [2005-09-16 21:31 UTC] leoli at optonline dot net
Description:
------------
ini_get('register_globals') always return empty string no matter what value is set in php.ini.

ini_get() function returns all other values defined in php.ini correctly.

Reproduce code:
---------------
/*
Our php.ini contains the following settings:

register_globals = On

*/

echo 'register_globals = ' . ini_get('register_globals') . "\n";

Expected result:
----------------
register_globals = 1

Actual result:
--------------
register_globals =


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-16 21:35 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

Can't reproduce.
 [2005-09-16 21:36 UTC] tony2001@php.net
Also, please use var_dump(ini_get("register_globals")); instead of echo.
 [2005-09-17 00:36 UTC] leoli at optonline dot net
I used php5.0-win32-latest.zip to reinstall PHP5

I used the follow code

<?php
/*
Our php.ini contains the following settings:

register_globals = On
engine = On
display_errors = On
y2k_compliance = On

*/

var_dump(ini_get('register_globals'));
var_dump(ini_get('engine'));
var_dump(ini_get('display_errors'));
var_dump(ini_get('y2k_compliance'));

?>

result:
string(0) "" string(0) "" string(1) "1" string(1) "1" 

The return values for
display_errors and y2k_compliance
are correct
 [2005-09-17 00:42 UTC] tony2001@php.net
Try this:
php.exe -n -d register_globals=1 -r 'var_dump(ini_get("register_globals"));'
or 
php -n -d register_globals=1 -r <path to your script>
 [2005-09-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2005-09-30 21:55 UTC] leoli at optonline dot net
register_globals has been defined twice in the php.ini
I have entered an extra register_globals statement by mistake.
I have removed it from the php.ini. I got the expected result now.

Thanks.
 [2005-10-01 10:31 UTC] johannes@php.net
No problem with PHP itself -> Bogus  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 16:01:32 2024 UTC