Skip to content

[Sync-EN] Add examples for filter_var_array() and filter_input_array() - #1790

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1694
Open

[Sync-EN] Add examples for filter_var_array() and filter_input_array()#1790
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1694

Conversation

@lacatoire

Copy link
Copy Markdown
Member

Syncs reference/filter/functions/filter-input-array.xml and reference/filter/functions/filter-var-array.xml with php/doc-en#5267 and php/doc-en#5699.

filter_input_array():

  • The return value is described accurately: null is returned when the input array is not populated, regardless of FILTER_NULL_ON_FAILURE; missing entries are null when add_empty is true and omitted when it is false, and unlike filter_input() the flag does not change that; with FILTER_FORCE_ARRAY a failure value is wrapped in a one element array like any other result.
  • The RU-only example, a leftover from a version of the English page that no longer has it, is replaced by the three upstream examples: filtering GET input with a failing entry, filtering POST data with a missing field, and requesting an input type that is not populated.
  • Mirrors the removal of the two empty xi:fallback elements.

filter_var_array():

  • The return value section gains the missing-entry and failure-value paragraphs, matching filter_input_array().
  • The first example gains the note that entries are filtered as scalars unless FILTER_REQUIRE_ARRAY or FILTER_FORCE_ARRAY is used, so the FILTER_REQUIRE_SCALAR flag in it only states the default explicitly.
  • Adds the "single filter for all values" and FILTER_CALLBACK examples.
  • Two wording fixes in the options description: the key corresponds to a key in the input array, and 'flags' specifies any flags that apply.

EN-Revision bumped to 85264ba268a398c4b90c1948839d54ce688dd5cd on both files.

Fixes: #1694

@lacatoire
lacatoire requested a review from a team as a code owner August 31, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sync EN] Add examples for filter_var_array() and filter_input_array()

1 participant