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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Thu Dec 05 19:01:30 2024 UTC