#26521 [Opn->Bgs]: =! is equal to 1?
| From: | derick@php.net | Date: | Thu, 04 Dec 2003 12:10:54 +0000 |
| Subject: | #26521 [Opn->Bgs]: =! is equal to 1? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51685@lists.php.net to get a copy of this message | ||
ID: 26521
Updated by: derick@php.net
Reported By: powerblade at mail dot dk
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows 2000
PHP Version: 5.0.0b2 (beta2)
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
=! is = ! (is not)
Previous Comments:
------------------------------------------------------------------------
[2003-12-04 07:06:40] powerblade at mail dot dk
Description:
------------
When doing the following script it has a VERY weird behavior
As you might notice we did a =! instead of !=. It was an error, but we
didn't notice.
Then we got the problem that it converted the content of the var to 1.
So the value was now missing. It took us quite some time to debug on
this one. Below is the script to reproduce the error. When running it,
it might seems clearer what i mean
Reproduce code:
---------------
<?php
$aTest = array(
'name' => 'And',
'email' => 'test@test.com'
);
echo "<pre>";
print_r($aTest);
if($aTest['name'] =! "") {
print_r($aTest);
}
echo "</pre>";
?>
Expected result:
----------------
Parse error. Can't do a =!. Should be a !=
Actual result:
--------------
Array
(
[name] => And
[email] => test@test.com
)
Array
(
[name] => 1
[email] => test@test.com
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26521&edit=1