php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67000 @MYCONST evaluates to string "MYCONST"
Submitted: 2014-04-01 13:39 UTC Modified: 2014-04-01 13:42 UTC
From: aleemb at gmail dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.5.10 OS: Ubuntu 12.04
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: aleemb at gmail dot com
New email:
PHP Version: OS:

 

 [2014-04-01 13:39 UTC] aleemb at gmail dot com
Description:
------------
The script below illustrates the issue.

Test script:
---------------
<?php
DEFINE('FOO', false);

if (@BAR) {
  echo "this is wrong.";
} else {
  echo "this is correct.";
}


if (@FOO) {
  echo "this is wrong.";
} else {
  echo "this is correct.";
}

var_dump(@BAR);

Expected result:
----------------
this is correct.this is correct.NULL

Actual result:
--------------
this is wrong.this is correct.string(3) "BAR"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-01 13:42 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2014-04-01 13:42 UTC] nikic@php.net
Drop the @ (the error suppression operator) and you'll understand.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 22:01:33 2024 UTC