From: Operating system: Linux PHP version: 5.3.4 Package: Output Control Bug Type: Bug Bug description:Asterisk character equals 0
Description: ------------ Using PHP Version 5.3.2-1ubuntu4.5. When a variable holds the value "*" and when being compared against the values 0 or "0" using the equal operator, true is always returned. I did look here: http://php.net/manual/en/language.types.type-juggling.php and I do not see a reason for this behavior. The Identical operator does however return false which is what you would expect. Test script: --------------- $var1 = "*"; if( $var1 == 0 ) { echo "ok"; } switch( $var1 ) { case 0 : echo "ok"; break; } $var2 = "\*"; if( $var2 == 0 ) { echo "ok"; } switch( $var2 ) { case 0 : echo "ok"; break; } Expected result: ---------------- Should return false. Actual result: -------------- Returns true; -- Edit bug report at http://bugs.php.net/bug.php?id=53584&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53584&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53584&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53584&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53584&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53584&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53584&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53584&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53584&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53584&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53584&r=support Expected behavior: http://bugs.php.net/fix.php?id=53584&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53584&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53584&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53584&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53584&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53584&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53584&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53584&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53584&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53584&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53584&r=mysqlcfg
