php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78959 FILTER_VALIDATE_FLOAT supports min_range in php >= 7.4.0
Submitted: 2019-12-13 15:16 UTC Modified: 2019-12-14 17:35 UTC
From: divinity76 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 7.4.0 OS:
Private report: No CVE-ID: None
 [2019-12-13 15:16 UTC] divinity76 at gmail dot com
Description:
------------
as can be seen here https://3v4l.org/BBUsI , 
 FILTER_VALIDATE_FLOAT supports min_range / max_range in >= 7.4.0 , 
but it's not documented anywhere as far as i can see, but there's 3 places i can think of where documentation would be appropriate: 

1: the 7.4.0 changelog at https://www.php.net/ChangeLog-7.php#7.4.0

2: the FILTER_VALIDATE_FLOAT documentation at https://www.php.net/manual/en/filter.filters.validate.php

3: (maybe? not sure?) the filter_var() documentation at https://www.php.net/manual/en/function.filter-var.php

Test script:
---------------
<?php

var_dump(
    filter_var(5,FILTER_VALIDATE_INT,array('options'=>array('min_range'=>6))),
    filter_var(5,FILTER_VALIDATE_FLOAT,array('options'=>array('min_range'=>6)))
    );

Expected result:
----------------
bool(false)
bool(false)


Actual result:
--------------
php < 7.4.0: 
bool(false)
float(5)
php >= 7.4.0: 
bool(false)
bool(false)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-14 17:33 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=web/php.git;a=commit;h=ce4dfd23d5617c9614f5e3f8d9a8719309941639
Log: Fix #78959: FILTER_VALIDATE_FLOAT supports min_range in php &gt;= 7.4.0
 [2019-12-14 17:33 UTC] cmb@php.net
-Status: Open +Status: Closed
 [2019-12-14 17:34 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348513
Log: Fix #78959: FILTER_VALIDATE_FLOAT supports min_range in php &gt;= 7.4.0
 [2019-12-14 17:35 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=fd39884841d5a2fec1746a9a7287dcd709f819d2
Log: Fix #78959: FILTER_VALIDATE_FLOAT supports min_range in php &gt;= 7.4.0
 [2019-12-14 17:35 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-12-14 17:35 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better
 [2020-02-07 06:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=97666ff44e99ab7d94546bfd5a6f29afa11023a6
Log: Fix #78959: FILTER_VALIDATE_FLOAT supports min_range in php &gt;= 7.4.0
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Nov 25 03:00:02 2025 UTC