Skip to content

Commit

Permalink
Add test for array_walk pass-by-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig committed Nov 19, 2020
1 parent 26f24af commit 29b6bb4
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ function function_with_ignored_reference_call() {
function function_with_wordpress_reference_calls() {
wp_parse_str('foo=bar', $vars);
}

function function_with_array_walk($userNameParts) {
array_walk($userNameParts, function (string &$value): void {
if (strlen($value) <= 3) {
return;
}

$value = ucfirst($value);
});
}

0 comments on commit 29b6bb4

Please sign in to comment.