php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53 $GLOBALS[] type
Submitted: 1998-02-10 22:23 UTC Modified: 1998-02-11 12:34 UTC
From: tomo at arts dot box dot co dot jp Assigned:
Status: Closed Package: Other
PHP Version: 3.0b4 OS: FreeBSD
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tomo at arts dot box dot co dot jp
New email:
PHP Version: OS:

 

 [1998-02-10 22:23 UTC] tomo at arts dot box dot co dot jp
'echo gettype($GLOBALS)' shows "string".

is it true?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-11 12:34 UTC] andi
$GLOBALS is a special variable. It is used to access global variables, like $GLOBALS["global_var"] but it 
cannot be used for anything else. You can't directly reference $GLOBALS, that is you can't do $a =$GLOBALS
 (the result will be false, which happens to be the empty string and thus you got a string type). 
Note that you can destroy $GLOBALS. If you do $GLOBALS=1, $GLOBALS will start acting like a regular 
local variable in the specific functions life time.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC