Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy