[PHP]Difference between require and include

require:
1.Upon failure it will also produce a fatalE_COMPILE_ERROR.
2. require() will always read in the target file, even if the line it's on never executes. That means if require() is in 'if', no matter whether the condition is met, the file will be read.

include:
1.Upon failure it will only emit a warning E_WARNING.
2.Can conditionally include a file.

评论

此博客中的热门博文

Openwrt路由器上配置shadowsocks透明代理+gfwlist(PAC)

Configure shadowsocks transparent proxy + gfwlist(PAC) on OpenWRT Router

Using Haproxy + shadowsocks (ha + ss) to setup multi ss backend and load balance