BastiaanOlij / bcompiler

Copy of bcompiler with small fixes, origin: http://pecl.php.net/package/bcompiler
4 stars 11 forks source link

Bad bytecode? #2

Open IngwiePhoenix opened 11 years ago

IngwiePhoenix commented 11 years ago

Hey!

So at some magical point, bcompiler finally did compile and work :)

Now however, I have a different issue. The bytecode compiled on one mashine doesnt work on the same mashine. Like, I did this:

<?php
echo "Compiling.\n";
$fh = fopen("hello.phb", "w");
bcompiler_write_header($fh);
bcompiler_write_file($fh, "hello.php");
bcompiler_write_footer($fh);
fclose($fh);

echo "Now including hello.php:\n";
include "hello.php";

echo "Now including hello.phb:\n";
include "hello.phb";
?>

The compile target is:

<?php   
    echo "Hello world! I am compiled.\n";
?>

And when I run php compile.php, this come sout:

Kevins-MacBook-Air:compile Ingwie$ php compile.php 
Compiling.
Now including hello.php:
Hello world! I am compiled.
Now including hello.phb:

Warning: bcompiler: Bad bytecode file format at 00000129 in  /Users/Ingwie/Work/compile/compile.php on line 13

Any suggestions?