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