com php-src: Fix opcache optimizer info for time_nanosleep: ext/opcache/Optimizer/zend_func_info.c

From: Date: Mon, 26 Aug 2019 09:13:26 +0000
Subject: com php-src: Fix opcache optimizer info for time_nanosleep: ext/opcache/Optimizer/zend_func_info.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-108051@lists.php.net to get a copy of this message
Commit: f5bccc0eb5bfe2b1c9ba55cf1df27f2a18a046fa Author: Tyson Andre <tysonandre775@hotmail.com> Sun, 25 Aug 2019 10:48:52 -0400 Committer: Nikita Popov <nikita.ppv@gmail.com> Mon, 26 Aug 2019 11:13:26 +0200 Parents: 16d35eb643bf974554e5264021ee10fc969e2053 Branches: PHP-7.2 PHP-7.3 PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f5bccc0eb5bfe2b1c9ba55cf1df27f2a18a046fa Log: Fix opcache optimizer info for time_nanosleep This can also return an array. See https://www.php.net/manual/en/function.time-nanosleep.php#refsect1-function.time-nanosleep-returnvalues > If the delay was interrupted by a signal, an associative array will be returned with the components: > > - seconds - number of seconds remaining in the delay > - nanoseconds - number of nanoseconds remaining in the delay Sending a SIGUSR1 to the below program would trigger this behavior. ``` pcntl_signal(\SIGUSR1, function ($signo, $signinfo) { echo "Handling a signal $signo\n"; }); echo "Sleeping for 100 seconds\n"; var_export(time_nanosleep(100, 0)); ``` The incomplete signature existed since c88ffa9a5. No phpt tests existed for time_nanosleep returning an array Changed paths: M ext/opcache/Optimizer/zend_func_info.c Diff: diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index b32a954..7f08104 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -277,7 +277,7 @@ static const func_info_t func_infos[] = { F0("sleep", MAY_BE_FALSE | MAY_BE_LONG), F0("usleep", MAY_BE_NULL | MAY_BE_FALSE), #if HAVE_NANOSLEEP - F0("time_nanosleep", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), + F0("time_nanosleep", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG), F0("time_sleep_until", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), #endif #if HAVE_STRPTIME

« previous php.cvs (#108051) next »