php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55421 0=="%"
Submitted: 2011-08-14 22:12 UTC Modified: 2011-08-14 22:29 UTC
From: php at jasonborro dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.3.6 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
19 + 14 = ?
Subscribe to this entry?

 
 [2011-08-14 22:12 UTC] php at jasonborro dot com
Description:
------------
Seriously, try it.

Test script:
---------------
if (0=="%") echo "FAIL!";

Expected result:
----------------
no FAIL!

Actual result:
--------------
FAIL!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-14 22:29 UTC] salathe@php.net
-Status: Open +Status: Bogus
 [2011-08-14 22:29 UTC] salathe@php.net
This is the expected and documented behaviour. To compare the string to an integer as in the test script, the string is translated to integer [1] as described in "String conversion to numbers" [2]. 

[1] http://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.types
[2] http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 01:01:33 2024 UTC