Home  >  Article  >  Backend Development  >  fastcgi_finish_request 与 && 优先级的问题

fastcgi_finish_request 与 && 优先级的问题

WBOY
WBOYOriginal
2016-06-06 20:51:211085browse

没错,写了一行很蛋疼代码,源码翻看了一下很头疼。求大大帮忙解释一下。

意思是:fastcgi完成以后继续执行cli
代码如下:

fastcgi_finish_request() && system($command, $result);

回复内容:

没错,写了一行很蛋疼代码,源码翻看了一下很头疼。求大大帮忙解释一下。

意思是:fastcgi完成以后继续执行cli
代码如下:

fastcgi_finish_request() && system($command, $result);

这是利用c语言的&&短路特性:如果前一个函数的返回值非零(true)则执行后一个函数;否则跳过。
相当于

if (fastcgi_finish_request())
    system(&command, result);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn