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

fastcgi_finish_request 与 && 优先级的问题

WBOY
Release: 2016-06-06 20:51:21
Original
1133 people have browsed it

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

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

fastcgi_finish_request() && system($command, $result);
Copy after login
Copy after login

回复内容:

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

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

fastcgi_finish_request() && system($command, $result);
Copy after login
Copy after login

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

if (fastcgi_finish_request())
    system(&command, result);
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template