php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42580 number_format() accepts arbitrary number
Submitted: 2007-09-06 15:30 UTC Modified: 2007-09-09 15:56 UTC
From: felipe at regex dot pro dot br Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.2.4 OS: Linux
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: felipe at regex dot pro dot br
New email:
PHP Version: OS:

 

 [2007-09-06 15:30 UTC] felipe at regex dot pro dot br
Description:
------------
number_format() accept arbitrary number. This not is a bug?!

Reproduce code:
---------------
php -r "print number_format(60123498237498274213112321232131313123211312341231231232132132131231212312312800000+1131231891232123211321123213123123213132132173172372173271312023611231231312312213732742374272744723743892357394579379475987230957234098572349587234958273498534721834729817489123647892163490178239471239804712947132418592345232722134798213748921734980127349801273984172983471289347182934721983478123412123456, 2, '', '');"
113123189123212324955467149877809757906281048416538247933974245606043206579547288521269650530917404359646878190387905563922085424503708932548183998822139088398884080392606482537801455313954955380942572389681685321249606629024043336119657124594910849146115016576016960896058277690962398527219045017132308889600

Actual result:
--------------
php -r "print number_format(60123498237498274213112321232131313123211312341231231232132132131231212312312800000+1131231891232123211321123213123123213132132173172372173271312023611231231312312213732742374272744723743892357394579379475987230957234098572349587234958273498534721834729817489123647892163490178239471239804712947132418592345232722134798213748921734980127349801273984172983471289347182934721983478123412123456, 2, '', '');"
113123189123212324955467149877809757906281048416538247933974245606043206579547288521269650530917404359646878190387905563922085424503708932548183998822139088398884080392606482537801455313954955380942572389681685321249606629024043336119657124594910849146115016576016960896058277690962398527219045017132308889600

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-09 15:56 UTC] iliaa@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

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 00:01:35 2025 UTC