Re: bcompiler strange behaviour on linux
| From: | val khokhlov | Date: | Tue, 30 Aug 2005 10:11:04 +0000 |
| Subject: | Re: bcompiler strange behaviour on linux | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2838@lists.php.net to get a copy of this message | ||
Hello Troy,
Tuesday, August 30, 2005, 12:33:30 PM, you wrote:
T> Whilst testing bcompiler on different platforms I noticed some
T> weird things happening on a Linux box. The testing stemmed from
T> what seems to be a bcompiler crash on a Linux 2.6.10 server running
T> php-4.3.10 with Zend Optimizer enabled. At this stage I am still
T> unsure what is causing the crash on that server, but in the mean
T> time I have found another quirk.
bcompiler shouldn't work with zend optimizer. they both intercept
zend_compile_file() call.
T> I set up a simple script on my test Linnux box (php-4.3.10-debug
T> with bcompiler-cvs) which creates a class, writes it as bytecode
T> to a file, then if the file exists, reads the bytecode and tries
T> to create an instance of the object.
your script works ok with php 5.0, 5.1 and (even) 6.0 :) but
causes some problems with php 4. i think, due to some minor bug. i'll
try to find and fix it.
the only thing i want to note - the way you've written your
script is kind of deprecated. the main idea of bcompiler is to replace
entire .php source files with bytecode equivalents.
so, the new-way code is:
(chicken_class.php)
<? class chicken { var $name = "henry"; function chicken () { } } ?>
(chicken_test.php)
<?
require_once 'chicken_class.phb';
$chook = new chicken();
echo "chicken is named $chook->name \n";
print_r ($chook);
?>
(compile.php)
$f = fopen($dst_name, "w");
bcompiler_write_header($f);
bcompiler_write_file($f, $src_name);
bcompiler_write_footer($f);
fclose($f);
--
Best regards,
val mailto:val@vk.kiev.ua