Hi aaron, thanks for your feedback.
Sorry, on the way from my tested code to my posting here the three dots ...
before $args were somewhere replaced by an ellipsis …
– looks similar, but is as wrong as a greek question mark instead of a semicolon (the classic prank).
And yes, with three dots it is valid PHP, see https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list
Edit: just learned that the CODE-Tag in the editor here prevents the three-dots-replace.
Change both lines from:
public function walk($elements, $max_depth) {
to:
public function walk($elements, $max_depth, ...$args) {
-
This reply was modified 5 years ago by cyrfer. Reason: The editor here replaced three dots with ellipsis where the dots are essential
-
This reply was modified 5 years ago by cyrfer.