xref: /PHP-8.1/ext/filter/tests/bug81708.phpt (revision 82f1bf1b)
1--TEST--
2Bug #81708 (UAF due to php_filter_float() failing for ints)
3--EXTENSIONS--
4filter
5--INI--
6opcache.enable_cli=0
7--FILE--
8<?php
9$input = "+" . str_repeat("1", 2); // avoid string interning
10filter_var(
11    $input,
12    FILTER_VALIDATE_FLOAT,
13    ["options" => ['min_range' => -1, 'max_range' => 1]]
14);
15var_dump($input);
16?>
17--EXPECT--
18string(3) "+11"
19