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
 [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 03:01:29 2024 UTC