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