php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54272 round only take 2 parameters
Submitted: 2011-03-16 13:52 UTC Modified: 2011-03-16 14:15 UTC
From: rsalmon at mbpgroup dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.17 OS: all
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: rsalmon at mbpgroup dot com
New email:
PHP Version: OS:

 

 [2011-03-16 13:52 UTC] rsalmon at mbpgroup dot com
Description:
------------
The documentation doesn't mention that the 3rd parameter only works with php 5.3+



Test script:
---------------
<?php
echo round(9.5, 0, PHP_ROUND_HALF_UP); 


Expected result:
----------------
10

Actual result:
--------------
Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in test.php on line 2

Warning: Wrong parameter count for round() in test.php on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-16 14:15 UTC] salathe@php.net
-Status: Open +Status: Bogus
 [2011-03-16 14:15 UTC] salathe@php.net
See the Changelog section on that page[1], which states: "5.3.0	 The mode 
parameter was introduced."

[1] http://php.net/manual/en/function.round.php
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Oct 12 23:00:01 2026 UTC