php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75262 Round function description (in case of fail)
Submitted: 2017-09-26 20:34 UTC Modified: 2017-09-27 05:20 UTC
From: vasekdvor at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 + 12 = ?
Subscribe to this entry?

 
 [2017-09-26 20:34 UTC] vasekdvor at gmail dot com
Description:
------------
I find out that there is no documentation about Math function "round()"
, about this situation:
 
'What will do the round function when there is invalid
entry being passed to a "float $val" ?'.

I think, that in others functions there is always written that if something goes wrong, that function will result in FALSE.For example floor function contains "This function returns FALSE in case of an error" in "Return values" section.

I have a script where i am using round function and accidentally happened to me that i (by mistake) gives that function, an empty variable and after that function has proceeded, i saw that the returned result is 0.

It's really confusing finding out what function creates this result if you have complex script.




Expected result:
----------------
I think that there should be described what will the function returns if something goes wrong.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-27 05:20 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC