expect_expectl(), when EOF is reached. * @link https://www.php.net/manual/en/expect.constants.php */ const EXP_EOF = -11; /** * Value, returned by expect_expectl() upon timeout of seconds, specified in value of expect.timeout * @link https://www.php.net/manual/en/expect.constants.php */ const EXP_TIMEOUT = -2; /** * Value, returned by expect_expectl() if no pattern have been matched. * @link https://www.php.net/manual/en/expect.constants.php */ const EXP_FULLBUFFER = -5; /** * Execute command via Bourne shell, and open the PTY stream to the process * * @param string $command Command to execute. * @return resource|false Returns an open PTY stream to the processes stdio, stdout, and stderr. * On failure this function returns FALSE. * @since PECL expect >= 0.1.0 * @link https://www.php.net/manual/en/function.expect-popen.php */ function expect_popen(string $command) { unset($command); return false; } /** * Waits until the output from a process matches one of the patterns, a specified time period has passed, * or an EOF is seen. * * If match is provided, then it is filled with the result of search. The matched string can be found in match[0]. * The match substrings (according to the parentheses) in the original pattern can be found in match[1], match[2], * and so on, up to match[9] (the limitation of libexpect). * * @param resource $expect An Expect stream, previously opened with expect_popen() * @param array $cases

An array of expect cases. Each expect case is an indexed array, as described in the following table:

*

* * Index Key * Value Type * Description * Is Mandatory * Default Value * * * 0 * string * pattern, that will be matched against the output from the stream * Yes * * * * 1 * mixed * value, that will be returned by this function, if the pattern matches * Yes * * * * 2 * integer * pattern type, one of: EXP_GLOB, EXP_EXACT or EXP_REGEXP * No * EXP_GLOB * *

* @param array &$match * * @return int Returns value associated with the pattern that was matched. * On failure this function returns: EXP_EOF, EXP_TIMEOUT or EXP_FULLBUFFER * @since PECL expect >= 0.1.0 * @link https://www.php.net/manual/en/function.expect-expectl.php */ function expect_expectl($expect, array $cases, array &$match = []): int { unset($expect, $cases, $match); return 0; }