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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: temp at oxygenws dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Fri Oct 11 02:01:26 2024 UTC