在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
bool assert ( mixed 1 assert_options(ASSERT_ACTIVE, true);//允许使用assert()函数 2 assert_options(ASSERT_WARNING, false);//在assert失败时不输出警告信息 3 assert_options(ASSERT_BAIL, true);//assert失败后终止代码执行 4 assert_options(ASSERT_CALLBACK, 'getMsg');//assert失败后终止代码执行。 5 6 echo '开始:<br/>'; 7 assert('mysql_query("")'); 8 echo '测试成功!'; 9 10 function getMsg(){ 11 echo '出错啦!'; 12 } mixed assert_options ( int ASSERT_ACTIVE : 是否启用 assert() 断言, ini配置 assert.active,默认值 1 ASSERT_WARNING :是否为每个失败的断言产生一个 PHP 警告,ini配置 assert.warning,默认1 ASSERT_BAIL :是否在断言失败时中止执行,ini配置 assert.bail,默认值0 ASSERT_QUIET_EVAL :是否在断言表达式求值时禁用 error_reporting,ini配置assert.quiet_eval,默认值0 ASSERT_CALLBACK :断言失败时调用回调函数,ini配置assert.callback 1 assert_options(ASSERT_ACTIVE, true);//允许使用assert()函数 2 assert_options(ASSERT_WARNING, false);//在assert失败时不输出警告信息 3 assert_options(ASSERT_BAIL, true);//assert失败后终止代码执行 4 assert_options(ASSERT_CALLBACK, 'getMsg');//assert失败后终止代码执行。 5 6 echo '开始:<br/>'; 7 assert(is_int(1.2));//检测结果为fales 8 echo '测试成功!'; 9 10 function getMsg(){ 11 echo '出错啦!'; 12 } bool dl( string $library ) — 获取 PHP 配置选项的值 载入指定的 PHP扩展 1 if(!extension_loaded('sqlite')){//测试指定的扩展是否已经激活 2 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; 3 dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX); 4 } int gc_collect_cycles() — 强制收集所有现存的垃圾循环周期 void gc_disable ( void ) — 停用循环引用收集器 void gc_enable ( void ) — 激活循环引用收集器 bool gc_enabled ( void ) — 返回循环引用计数器的状态 string get_cfg_var ( string string get_current_user ( void )— 获取当前 PHP 脚本所有者名称 array get_defined_constants ([ bool array get_extension_funcs ( string print_r(get_extension_funcs("xml")); string get_include_path ( void ) — 获取当前的 include_path 配置选项 array get_included_files ( void )— 返回被 include 和 require 文件名的 array 1 include 'test1.php'; 2 include_once 'test2.php'; 3 require 'test3.php'; 4 require_once 'test4.php'; 5 6 $included_files = get_included_files(); 7 8 foreach ($included_files as $filename){ 9 echo "$filename\n"; 10 } array get_loaded_extensions ([ bool bool get_magic_quotes_gpc ( void )— 获取当前 magic_quotes_gpc 的配置选项设置 bool get_magic_quotes_runtime ( void ) — 获取当前 magic_quotes_runtime 配置选项的激活状态 string getenv ( string $ip = getenv('REMOTE_ADDR'); int getlastmod ( void )— 获取页面最后修改的时间 int getmygid ( void )— 获取当前 PHP 脚本拥有者的 GID int getmyinode ( void )— 获取当前脚本的索引节点(inode) int getmypid ( void )— 获取 PHP 进程的 ID int getmyuid ( void )— 获取 PHP 脚本所有者的 UID array getopt ( string array getrusage ([ int array ini_get_all ([ string print_r(ini_get_all("pcre")); print_r(ini_get_all()); string ini_get ( string void ini_restore ( string string ini_set ( string main — 虚拟的 main()int memory_get_peak_usage ([ bool string php_ini_loaded_file ( void ) — 取得已加载的 php.ini 文件的路径 string php_ini_scanned_files ( void )— 返回从额外 ini 目录里解析的 .ini 文件列表 string php_sapi_name ( void ) — 返回 web 服务器和 PHP 之间的接口类型 string php_uname ([ string
bool phpcredits ([ int CREDITS_ALL :所有的 CREDITS_DOCS : 文档组贡献名单 CREDITS_FULLPAGE : 常用于和其他标志进行组合。 表示需要打印包含其他标志表示信息的独立 HTML 页面。 CREDITS_GENERAL : 普遍名单:语言设计与理念、PHP作者以及 SAPI 模块 CREDITS_GROUP : 核心开发者名单 CREDITS_MODULES : PHP 扩展模块以及作者 CREDITS_SAPI : PHP 的服务器 API 模块以及作者 phpcredits(CREDITS_GROUP | CREDITS_DOCS | CREDITS_FULLPAGE);
bool phpinfo ([ int string phpversion ([ string bool putenv ( string void restore_include_path ( void ) — 还原 include_path 配置选项的值 string set_include_path ( string void set_time_limit ( int string sys_get_temp_dir ( void ) — 返回用于临时文件的目录 mixed version_compare ( string if (version_compare(PHP_VERSION, '5.3.0') >= 0) { echo '我的PHP版本很高: ' . PHP_VERSION . "\n"; } int zend_thread_id ( void ) — 返回当前线程的唯一识别符 string zend_version ( void ) — 获取当前 Zend 引擎的版本 |
2022-08-30
2022-08-15
2022-08-17
2022-11-06
2022-08-18
请发表评论