php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29981 '08'!=08
Submitted: 2004-09-05 00:53 UTC Modified: 2004-09-05 01:08 UTC
From: temp at oxygenws dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.0.0 OS: Linux/Windows
Private report: No CVE-ID: None
 [2004-09-05 00:53 UTC] temp at oxygenws dot com
Description:
------------
look at this code:
========================
<?php
$num2='02';
$num8='08';
if($num2==02) echo '2';
echo "\n";
if($num8==08) echo '8';
?>
========================

it is output:
========================
2

========================

but what is the difference between 02 and 08?!
i think it is a bug!

best regards, omid

Reproduce code:
---------------
<?php
$num2='02';
$num8='08';
if($num2==02) echo '2';
echo "\n";
if($num8==08) echo '8';
?>

Expected result:
----------------
2


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-05 01:08 UTC] eru@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 numbers are prefixed with a zero.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 01:01:30 2024 UTC