It looks like as of bcompiler 0.9.3 geoff's code above works correctly with the output:
static
construct
testOut
PHP バイトコードコンパイラ
- 導入
- インストール/設定
- 定義済み定数
- bcompiler 関数
- bcompiler_load_exe — bcompiler の exe ファイルを読み込み、クラスを生成する
- bcompiler_load — bz 圧縮されたファイルを読み込み、クラスを生成する
- bcompiler_parse_class — クラスのバイトコードを読み込み、ユーザ関数をコールする
- bcompiler_read — ファイルハンドルを読み込み、クラスを生成する
- bcompiler_write_class — 定義したクラスをバイトコードとして書き込む
- bcompiler_write_constant — 定義した定数をバイトコードとして書き込む
- bcompiler_write_exe_footer — 開始位置および exe 形式ファイルのフッタを書き込む
- bcompiler_write_file — php ソースファイルをバイトコードとして書き込む
- bcompiler_write_footer — コンパイルされたデータの終了を示す文字 \x00 を書き込む
- bcompiler_write_function — 定義した関数をバイトコードとして書き込む
- bcompiler_write_functions_from_file — ファイル内で定義されているすべての関数をバイトコードとして書き込む
- bcompiler_write_header — bcompiler のヘッダを書き込む
- bcompiler_write_included_filename — インクルードされたファイルをバイトコードとして書き込む
rustushki
29-Dec-2010 07:05
geoff at spacevs dot com
08-Apr-2010 12:08
static vars on classes do not work with bcompiler, eg.
<?PHP
class testClass {
static public $i;
static public function testStatic() {
echo "static\n";
testClass::$i = new testClass();
}
public function __construct() {
echo "construct\n";
}
public function testOut() {
echo "testOut\n";
}
}
testClass::testStatic();
testClass::$i->testOut();
?>
the call to "testOut" will silently fail.
