Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case 'filter' array_keys() expects parameter 1 to be array, null given #89

Open
CB9TOIIIA opened this issue Oct 27, 2021 · 0 comments
Open

Comments

@CB9TOIIIA
Copy link
Contributor

Есть Warning, думаю нужно сделать проверку на NULL $elements или иную, также задать $key

 $key = implode(', ', array_map(
                            function ($v, $k) {
                                if (is_array($v)) {
                                    $v = implode('||', $v);
                                }
                                return sprintf("%s:%s", $k, $v); 
                            },
                            $elements,
                            array_keys($elements)
                        ));
if (NULL !== $elements) {
                        $key = implode(', ', array_map(
                            function ($v, $k) {
                                if (is_array($v)) {
                                    $v = implode('||', $v);
                                }
                                return sprintf("%s:%s", $k, $v); 
                            },
                            $elements,
                            array_keys($elements)
                        ));
                    }
                    else {
                        $key = 0; // или NULL
                    }

image

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

No branches or pull requests

1 participant