php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40096 PHP claims that 'GLOBALS' == 0
Submitted: 2007-01-11 04:44 UTC Modified: 2007-01-11 15:09 UTC
From: christian at rishoj dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.0 OS: Ubuntu Dapper
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: christian at rishoj dot net
New email:
PHP Version: OS:

 

 [2007-01-11 04:44 UTC] christian at rishoj dot net
Description:
------------
The expression 

  'GLOBALS' == 0

evaluates to true.

Reproduce code:
---------------
php -r 'echo ('GLOBALS' == 0) ? 'yes' : 'no'; echo "\n";'


Expected result:
----------------
no

Actual result:
--------------
yes

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-11 05:53 UTC] judas dot iscariote at gmail dot com
Turn on error_reporting, this is the expected behaviuor

php -r 'echo ('GLOBALS' == 0) ? 'yes' : 'no'; echo "\n";'
PHP Notice:  Use of undefined constant GLOBALS - assumed 'GLOBALS' in Command line code on line 1
PHP Notice:  Use of undefined constant yes - assumed 'yes' in Command line code on line 1
yes
 [2007-01-11 08:07 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.
 [2007-01-11 15:09 UTC] christian at rishoj dot net
Right, it's actually well documented:

http://www.php.net/manual/en/language.operators.comparison.php
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC