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 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.
(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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Mar 19 04:01:31 2024 UTC