xref: /PHP-8.0/ext/filter/tests/bug73054.phpt (revision a555cc0b)
1--TEST--
2Bug #73054 (default option ignored when object passed to int filter)
3--SKIPIF--
4<?php
5if (!extension_loaded('filter')) die('skip filter extension not available');
6?>
7--FILE--
8<?php
9var_dump(
10    filter_var(new stdClass, FILTER_VALIDATE_INT, [
11        'options' => ['default' => 2],
12    ]),
13    filter_var(new stdClass, FILTER_VALIDATE_INT, [
14        'options' => ['default' => 2],
15        'flags' => FILTER_NULL_ON_FAILURE
16    ])
17);
18?>
19--EXPECT--
20int(2)
21int(2)
22