#26521 [NEW]: =! is equal to 1?

From: Date: Thu, 04 Dec 2003 12:06:43 +0000
Subject: #26521 [NEW]: =! is equal to 1?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51683@lists.php.net to get a copy of this message
From: powerblade at mail dot dk Operating system: Windows 2000 PHP version: 5.0.0b2 (beta2) PHP Bug Type: Scripting Engine problem Bug description: =! is equal to 1? 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 bug report at http://bugs.php.net/?id=26521&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26521&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26521&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26521&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26521&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26521&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26521&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26521&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26521&r=support Expected behavior: http://bugs.php.net/fix.php?id=26521&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26521&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26521&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26521&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26521&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26521&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26521&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26521&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26521&r=float

« previous php.bugs (#51683) next »