php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26951 INT issue, passing 08 results in 0
Submitted: 2004-01-17 21:33 UTC Modified: 2004-01-18 05:31 UTC
Votes:6
Avg. Score:3.3 ± 1.2
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: jake at presstec dot net Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: 4.3.4 OS: Linux 2.4.
Private report: No CVE-ID: None
 [2004-01-17 21:33 UTC] jake at presstec dot net
Description:
------------
This is very simple too understand from the example code,passing 08 or 09 results in 0..... 

Errr umm... what the?! 

Thanks

Reproduce code:
---------------
<?php

function p($val)
{
    echo "$val<br/>";
}

p(01);
p(05);
p(08);
p(09);

?>

Expected result:
----------------
1<br/>5<br/>8<br/>9<br/>

Actual result:
--------------
1<br/>5<br/>0<br/>0<br/>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-17 21:52 UTC] pluggz24 at yahoo dot com
This isn't a bug; this is proper behavior for an octal integer. 08 and 09 are both undefined, as an octal value can have digits 0-7 :/

I don't see this as being a bug.
 [2004-01-18 05:31 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

Ocalt restrictions
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 05 22:01:28 2024 UTC