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

Match array not initialized and filled in expect_expectl in PHP 7.4.33 #4

Open
lachbaer opened this issue Feb 28, 2023 · 1 comment

Comments

@lachbaer
Copy link

I experience the problem in PHP 7.4.33 that the match array is not initialized and populated. It keeps the state and value it has before calling expect_expectl, no matter how or if it was declared and defined before the call. Beside that expect_expectl works as intended, recognizes all mateches and returns the corresponding values.

When initializing it as in array, it once worked, but after the last weekend it stopped working again and shows the same irrational behaviour as above.

$match=[];
expect_expectl ($stream, array (
    array ("Username: ", "USERNAME"), //TELNET USER NAME
    array ("password: ", "PASSWORD"), // SSH is asking for password
    array ("Password: ", "PASSWORD1"), // SSH is asking for password
    array ("yes/no)?", "YESNO"), // SSH is asking whether to store the host entry
    array ("# ", "SHELL", EXP_EXACT) //We've got the shell!
    ), $match);
lachbaer pushed a commit to lachbaer/pecl-expect that referenced this issue Feb 28, 2023
Done like in function php_pcre_match_impl() of PCRE module.
@romeor
Copy link

romeor commented Feb 16, 2024

any updates on this one? got the same issue. $match is always empty.

sibaz added a commit that referenced this issue Aug 5, 2024
Fix issue #4 - match array not initialized
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

2 participants