导航首页 » 技术教程 » PHP:__halt_compiler()的用法_misc函数
PHP:__halt_compiler()的用法_misc函数 154 2023-12-15   

__halt_compiler

(PHP 5 >= 5.1.0)

__halt_compiler — 中断编译器的执行

说明

void __halt_compiler ( void )

中断编译器的执行。常用于在PHP脚本内嵌入数据,类似于安装文件。

可以通过常量 __COMPILER_HALT_OFFSET__ 获取数据开始字节所在的位置,且该常量仅被定义于使用了__halt_compiler的文件。

返回值

没有返回值。

范例

Example #1 A __halt_compiler() 例子

<?php

// open this file
$fp = fopen(__FILE__, 'r');

// seek file pointer to data
fseek($fp, __COMPILER_HALT_OFFSET__);

// and output it
var_dump(stream_get_contents($fp));

// the end of the script execution
__halt_compiler(); the installation data (eg. tar, gz, PHP, etc.)

注释

Note:

__halt_compiler() 仅能够在最外层使用。


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103