写给愿意动手的 PHP 开发者
PHP学习网 PHP学习网
公告PHP学习网为公益性网站,致力于为广大PHP爱好者服务
首页/ PHP 函数大全/ 运行环境
Env

PHP 运行环境函数

常量、环境检测、错误级别、执行时间、扩展判断,写可移植代码时会用到。

函数说明返回
class_exists() 判断类是否已定义。 bool
define() 定义一个常量,定义后不能修改。 bool
defined() 判断常量是否已定义。 bool
error_reporting() 设置当前脚本记录哪些级别的错误。 int
function_exists() 判断函数是否已定义,常用于检测扩展是否安装。 bool
ini_set() 在运行时修改 php.ini 配置,只对当前请求有效。 string|false
set_error_handler() 注册自定义错误处理函数,可以把警告转成异常。 ?callable
sleep() 让脚本暂停指定秒数。 int