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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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 18:01:30 2024 UTC