Bug #67000 [Opn->Nab]: @MYCONST evaluates to string "MYCONST"

From: Date: Tue, 01 Apr 2014 13:42:17 +0000
Subject: Bug #67000 [Opn->Nab]: @MYCONST evaluates to string "MYCONST"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185007@lists.php.net to get a copy of this message
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)

« previous php.bugs (#185007) next »