php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47259 Error on eval with left ceroes (example : eval('08'));
Submitted: 2009-01-31 23:39 UTC Modified: 2009-02-01 00:27 UTC
From: jesusgonzalez at hotmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2CVS-2009-01-31 (snap) OS: FEDORA CORE 9
Private report: No CVE-ID: None
 [2009-01-31 23:39 UTC] jesusgonzalez at hotmail dot com
Description:
------------
There's something wrong when evaluating '08' and '09' as number.

Reproduce code:
---------------
<?php
echo 'Version: ' . phpversion() . "<br>";
eval('$one = (01);'); echo $one . "<br>";
eval('$two = (02);'); echo $two . "<br>";
eval('$three = (03);');	echo $three . "<br>";
eval('$four = (04);'); 	echo $four . "<br>";
eval('$five = (05);'); echo $five . "<br>";
eval('$six = (06);'); echo $six . "<br>";
eval('$seven = (07);');	echo $seven . "<br>";
eval('$eight = (08);');	echo $eight . "<br>";
eval('$nine = (09);'); echo $nine . "<br>";
eval('$ten = (10);'); echo $ten . "<br>";
echo "<br>";
?>




Expected result:
----------------
Version: 5.2.6
1
2
3
4
5
6
7
8
9
10

Actual result:
--------------
Version: 5.2.6
1
2
3
4
5
6
7
0
0
10


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-31 23:42 UTC] jani@php.net
Welcome new user to wonderful world of programming. Next lesson: 
Figure out how to use a search engines in general. You wasted my time 
and caused significant amount of carbon dioxide emissions by 
submitting this report. 

Hint: OCTAL..
 [2009-02-01 00:27 UTC] jesusgonzalez at hotmail dot com
Why the offensive answer?
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 07:01:31 2025 UTC