php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8403 Number Parsing error
Submitted: 2000-12-24 10:35 UTC Modified: 2000-12-24 11:07 UTC
From: anil at recoil dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4 OS: OpenBSD 2.8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: anil at recoil dot org
New email:
PHP Version: OS:

 

 [2000-12-24 10:35 UTC] anil at recoil dot org
A friend pointed this out, and it really does seem wierd.
This script:

<?
$a = 090;
var_dump($a);
$b = 90;
var_dump($b);
?>

Produces the following output:
int(0)
int(90)

Why is '090' getting parsed to int(0), when it should
be int(90) ?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-24 11:07 UTC] anil at recoil dot org
And ... doh!  Pretty much any other number would have shown
that it's octal syntax.

<?
$a = 070;
var_dump($a);
$b = 70;
var_dump($b);
?>

int(56)
int(70)

thanks sascha :)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Oct 12 07:00:02 2026 UTC