Bug #67000 [Opn->Nab]: @MYCONST evaluates to string "MYCONST"
Edit report at https://bugs.php.net/bug.php?id=67000&edit=1
ID: 67000
Updated by: nikic@php.net
Reported by: aleemb at gmail dot com
Summary: @MYCONST evaluates to string "MYCONST"
-Status: Open
+Status: Not a bug
Type: Bug
Package: Variables related
Operating System: Ubuntu 12.04
PHP Version: 5.5.10
Block user comment: N
Private report: N
New Comment:
Drop the @ (the error suppression operator) and you'll understand.
Previous Comments:
------------------------------------------------------------------------
[2014-04-01 13:39:01] 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"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67000&edit=1
Thread (2 messages)