|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16915 Problems with super globals variables
Submitted: 2002-04-29 14:53 UTC Modified: 2002-08-22 12:55 UTC
From: Jakub dot Gnat at webdynamix dot de Assigned:
Status: Not a bug Package: Servlet related
PHP Version: 4.2.0 OS: SuSe Linux 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: Jakub dot Gnat at webdynamix dot de
New email:
PHP Version: OS:


 [2002-04-29 14:53 UTC] Jakub dot Gnat at webdynamix dot de
It seems to be that all super arrays are empty:

This script: 
	echo "Globals test: <br>";

	if (is_array($_SERVER)) {
		$size = sizeof($_SERVLET);
		echo "_SERVER is array $size <br>";
		foreach ($_SERVER as $key => $value) {
			echo "Key: $key value: $value <br>";

	if (is_array($_GET)) {
		$size = sizeof($_GET);
		echo "_GET is array $size <br>";
		foreach ($_GET as $key => $value) {
			echo "Key: $key value: $value <br>";

	if (is_array($_POST)) {
		$size = sizeof($_POST);
		echo "_POST is array $size <br>";
		foreach ($_POST as $key => $value) {
			echo "Key: $key value: $value <br>";

	if (is_array($_ENV)) {
		$size = sizeof($_ENV);
		echo "_ENV is array $size <br>";
		foreach ($_ENV as $key => $value) {
			echo "Key: $key value: $value <br>";
	echo "PHP_SELF $PHP_SELF <br>";


as result:

Globals test: 
_SERVER is array 0 
_GET is array 0 
_POST is array 0 
_ENV is array 0 
PHP_SELF /examples/php-servlet/test/global.php 

The arrays are empty.

My environment: 
OS=Linux 2.4.10-4GB on i386 
Tomcat 3.2.3 I use only Tomcat as web server without apache. 
Java version=1.3.1_03 
Java vendor=Sun Microsystems Inc. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-29 18:47 UTC] preston dot bannister at cox dot net
This doesn't look like a PHP bug.

First, you used _SERVLET were you meant to say _SERVER in your example.  An understandable mistake for someone who spends a lot of time with Java servlets :).

Second, the _GET and _POST arrays were empty for the simple (and correct) reason that you did not have any GET or POST parameters to your request.

Third, the _ENV array is empty simply because Java didn't pass any environment values - or at least that would be my suspicion.  Check your Runtime.exec() call and the semantics of this call.
 [2002-04-30 05:28 UTC] Jakub dot Gnat at webdynamix dot de
I tried once again the globals and $_GET $_POST work. Sorry for the confusion. I change a $_SERVLET to $_SERVER :-), but again at this time $_SERVER array is empty. $GLOBALS works. I don't have any idea how can I check a Runtime.exec() call and the semantic of this call. Can you help me with this. 

Kind regards
 [2002-08-22 12:55 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

If you still experience the problem. Change $_SERVER to $HTTP_SERVER_VARS, $ENV to $HTTP_ENV_VARS and so on and see if those are empty as well.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Aug 12 09:05:46 2022 UTC