Skip to content

ext/filter: filter_var_array with FILTER_VALIDATE_INT|FILTER_NULL_ON_FAILURE as $options fails. #16994

Open
@Girgias

Description

@Girgias

Description

The following code:

<?php
$data = [
    'product_id' => '42',
    'component'  => '10.36',
];

var_dump(filter_var_array($data, FILTER_VALIDATE_INT|FILTER_NULL_ON_FAILURE));

Resulted in this output:

Warning: filter_var_array(): Unknown filter with ID 134217985 in %s on line %d
bool(false)

But I expected this output instead:

array(2) {
  ["product_id"]=>
  int(42)
  ["component"]=>
  NULL
}

PHP Version

PHP 5.4.0 to master

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions