php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33461 Compare strings problem (I'm not good in english)
Submitted: 2005-06-24 06:21 UTC Modified: 2005-06-24 10:10 UTC
From: marting dot dc at gmail dot com Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 4.3.11 OS: Windows and Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marting dot dc at gmail dot com
New email:
PHP Version: OS:

 

 [2005-06-24 06:21 UTC] marting dot dc at gmail dot com
Description:
------------
When you try to compare an empty string with any number who begins with 09 or 08 (booth includes) it returns true.

I have it tested on Windows and Linux and it happends

(I'm Sorry for my English, it's very bad,I hope you to understand me)

Mart?n Gonz?lez

Reproduce code:
---------------
$string = false;

if ($string == 09) { echo "Match<br>\n"; }

if ($string == 08) { echo "Match<br>\n"; }

if ($string == 09547856) { echo "Match<br>\n"; }

if ($string == 08625131) { echo "Match<br>\n"; }

/*
It will return:

Match
Match
Match
Match
*/

Expected result:
----------------
Nothing

Actual result:
--------------
Match
Match
Match
Match

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-24 10:10 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See here: http://www.php.net/manual/en/language.types.type-juggling.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC