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 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: 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

Pull Requests

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: Fri Dec 27 01:01:28 2024 UTC