summaryrefslogtreecommitdiff
path: root/ext/filter/tests/054.phpt
blob: 2b6f3000dac4713cf436df6b7643908ddf7c7d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
filter_var_array() - using the add_empty option
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php

$data = array('foo' => 123);

var_dump(
    filter_var_array($data, array('foo' => array('filter' => FILTER_DEFAULT), 'bar' => array('filter' => FILTER_DEFAULT)), false),
    filter_var_array($data, array('foo' => array('filter' => FILTER_DEFAULT), 'bar' => array('filter' => FILTER_DEFAULT)))
);

?>
--EXPECT--
array(1) {
  ["foo"]=>
  string(3) "123"
}
array(2) {
  ["foo"]=>
  string(3) "123"
  ["bar"]=>
  NULL
}