foo.exe (compiled):
<?php
class myclass {
static $scalar = 'Hello World!';
}
?>
foo.php:
<?php
include 'foo.exe';
echo myclass::$scalar;
?>
As you can see, simply including the file will also work perfectly (oh joy!)
(PECL bcompiler >= 0.4)
bcompiler_load_exe — 从一个 bcompiler exe 文件中读取并创建类
$filename
)从一个 bcompiler exe 文件中读取数据并根据字节码创建类。
filename
exe文件的路径,是一个字符串。
成功时返回 TRUE
, 或者在失败时返回 FALSE
。
Example #1 bcompiler_load_exe() 例子
<?php
bcompiler_load_exe("/tmp/example.exe");
print_r(get_defined_classes());
?>
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担 。
foo.exe (compiled):
<?php
class myclass {
static $scalar = 'Hello World!';
}
?>
foo.php:
<?php
include 'foo.exe';
echo myclass::$scalar;
?>
As you can see, simply including the file will also work perfectly (oh joy!)