php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23806 $GLOBALS array contains an unexpected entry
Submitted: 2003-05-25 18:37 UTC Modified: 2003-05-25 21:22 UTC
From: edawg at e-dawg dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.3.2RC4 OS: FreeBSD 4.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: edawg at e-dawg dot com
New email:
PHP Version: OS:

 

 [2003-05-25 18:37 UTC] edawg at e-dawg dot com
A key in the $GLOBALS array contains what appears to be the result of serializing an array.  I have fixed the problem in the code with a regexp, but I don't think it's supposed to be there.

Code to show this:
$global_keys = array_keys($GLOBALS);
foreach ($global_keys as $key)
{
  echo $key . ' - ' . $GLOBALS[$key] . '<br>';
}

On a very simple page this results in nothing but the expected variables. However, on a large and complex page I get this among the results:
;s:6:"weight";d:0;};s:6:"weight";d:0;}language - 

I'm going to take a wild stab that it's adding the result of serialization of some variable into the array keys with no value rather than adding the key and the serialized value.

The same function worked flawlessly without the regexp in PHP 4.3.1 with the exact same configuration.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-25 20:49 UTC] edawg at e-dawg dot com
Sure enough, it's fixed in that CVS snapshot.
 [2003-05-25 21:22 UTC] sniper@php.net
So it was the same problem that was already reported,
but thanks anyway. :) (the fix will be in PHP 4.3.2)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 06:01:34 2024 UTC