💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
Runkit扩展提供了修改常量,用户定义的函数和用户定义的类的方法。它还通过沙箱提供自定义的超全局变量和可嵌入的子解释器。 该软件包是对[»classkit](https://pecl.php.net/package/classkit)软件包的补充功能。使用*\--enable-runkit = classkit*选项编译到./configure时,它将导出与classkit兼容的函数定义和常量。 下载安装包 [https://pecl.php.net/package/runkit](https://pecl.php.net/package/runkit) ## 运行时配置 这些函数的行为受php.ini中的设置影响。 **Runkit Configuration Options** | 名字 | 默认 | 可修改范围 | 更新日志 | | --- | --- | --- | --- | | [runkit.superglobal](https://www.php.net/manual/zh/runkit.configuration.php#ini.runkit.superglobal) | "" | PHP\_INI\_PERDIR |   | | [runkit.internal\_override](https://www.php.net/manual/zh/runkit.configuration.php#ini.runkit.internal-override) | "0" | PHP\_INI\_SYSTEM | * [Runkit\_Sandbox](https://www.php.net/manual/en/runkit.sandbox.php)— Runkit沙箱类-PHP虚拟机 * [Runkit\_Sandbox\_Parent](https://www.php.net/manual/en/runkit.sandbox-parent.php)— Runkit防沙箱类 * [runkit\_class\_adopt](https://www.php.net/manual/en/function.runkit-class-adopt.php)—将基类转换为继承的类,并在适当时添加祖先方法 * [runkit\_class\_emancipate](https://www.php.net/manual/en/function.runkit-class-emancipate.php)—将继承的类转换为基类,删除范围为祖先的任何方法 * [runkit\_constant\_add](https://www.php.net/manual/en/function.runkit-constant-add.php)—与define()类似,但也允许在类定义中进行定义 * [runkit\_constant\_redefine](https://www.php.net/manual/en/function.runkit-constant-redefine.php)—重新定义一个已经定义的常量 * [runkit\_constant\_remove](https://www.php.net/manual/en/function.runkit-constant-remove.php)—删除/删除一个已经定义的常量 * [runkit\_function\_add](https://www.php.net/manual/en/function.runkit-function-add.php)—添加一个新函数,类似于create\_function * [runkit\_function\_copy](https://www.php.net/manual/en/function.runkit-function-copy.php)—将函数复制到新的函数名称 * [runkit\_function\_redefine](https://www.php.net/manual/en/function.runkit-function-redefine.php)—用新的实现替换函数定义 * [runkit\_function\_remove](https://www.php.net/manual/en/function.runkit-function-remove.php)—删除函数定义 * [runkit\_function\_rename](https://www.php.net/manual/en/function.runkit-function-rename.php)—更改函数的名称 * [runkit\_import](https://www.php.net/manual/en/function.runkit-import.php)—处理PHP文件导入功能和类定义,并在适当情况下覆盖 * [runkit\_lint\_file](https://www.php.net/manual/en/function.runkit-lint-file.php)—检查指定文件的PHP语法 * [runkit\_lint](https://www.php.net/manual/en/function.runkit-lint.php)—检查指定的php代码的PHP语法 * [runkit\_method\_add](https://www.php.net/manual/en/function.runkit-method-add.php)—动态地将新方法添加到给定的类 * [runkit\_method\_copy](https://www.php.net/manual/en/function.runkit-method-copy.php)—将方法从类复制到另一个 * [runkit\_method\_redefine](https://www.php.net/manual/en/function.runkit-method-redefine.php)—动态更改给定方法的代码 * [runkit\_method\_remove](https://www.php.net/manual/en/function.runkit-method-remove.php)—动态删除给定的方法 * [runkit\_method\_rename](https://www.php.net/manual/en/function.runkit-method-rename.php)—动态更改给定方法的名称 * [runkit\_return\_value\_used](https://www.php.net/manual/en/function.runkit-return-value-used.php)—确定是否将使用当前函数的返回值 * [runkit\_sandbox\_output\_handler](https://www.php.net/manual/en/function.runkit-sandbox-output-handler.php)—指定一个函数以捕获和/或处理来自runkit沙箱的输出 * [runkit\_superglobals](https://www.php.net/manual/en/function.runkit-superglobals.php)—返回已注册超全局变量的数字索引数组