php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21638 Wrong values
Submitted: 2003-01-14 11:56 UTC Modified: 2003-01-14 11:58 UTC
From: n dot uni9 at terra dot com dot br Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.3 OS: Windows XP Professional
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: n dot uni9 at terra dot com dot br
New email:
PHP Version: OS:

 

 [2003-01-14 11:56 UTC] n dot uni9 at terra dot com dot br
<?php 

$a = array(01,08,10,15,17,20);
$b = array(001,008,012,015,170,200);
for($i=0; $i<count($a); $i++) {
	echo($i." - ".$a[$i]." - ".$b[$i]."<br>");
}

$c= 011;
echo("\$c = ".$c);
?>

## OUTPUT ##

0 - 1 - 1
1 - 0 - 0
2 - 10 - 10
3 - 15 - 13
4 - 17 - 170
5 - 20 - 200
$c = 9

-----------------------
All the numbers, from "8" to up, if preceded by zero, outputs another value.
-----------------------

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-14 11:58 UTC] derick@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

those are octal numbers... check the manual again.

Derick
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC