php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26521 =! is equal to 1?
Submitted: 2003-12-04 07:06 UTC Modified: 2003-12-04 07:10 UTC
From: powerblade at mail dot dk Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0b2 (beta2) OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: powerblade at mail dot dk
New email:
PHP Version: OS:

 

 [2003-12-04 07:06 UTC] 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
)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-04 07:10 UTC] derick@php.net
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)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 10:01:30 2024 UTC