php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23246 == operator
Submitted: 2003-04-16 14:51 UTC Modified: 2003-04-16 15:09 UTC
From: tdietrich at sst dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.0 OS: Solaris
Private report: No CVE-ID: None
 [2003-04-16 14:51 UTC] tdietrich at sst dot com
echo '8'. ((08 == 8) ? 'true':'false')."<br>\n";
echo '2'. ((02 == 2) ? 'true':'false')."<br>\n";

the first line returns false, but the 2nd line returns true.
This will return true for any number less than 8.  possibly has to do with the two byte conversion...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-16 15:09 UTC] helly@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

Octal notation is marked by a leading 0:

marcus@zaphod /usr/src/php5 $ php -r 'echo (08)."\n";'
0
marcus@zaphod /usr/src/php5 $ php -r 'echo (07)."\n";'
7
marcus@zaphod /usr/src/php5 $ php -r 'echo (010)."\n";'
8
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 15:01:33 2024 UTC