3 ms·
>Is there anything about PHP that would make Truffle a bad fit? Perhaps one barrier would be the insane number of built-in functions. There's 1000+[1]. And, a
by tyingq 10y ago
>Is there anything about PHP that would make Truffle a bad fit?
Perhaps one barrier would be the insane number of built-in functions. There's 1000+[1]. And, as far as I can tell, most of them tied to underlying C code versus being written in PHP themselves.
The other might be that because of the built-in templating thing, you would have to parse html as well, to find the embedded PHP. I'm not sure how well that aligns with Truffle's approach. Things like this:
<ul>
<?php foreach ($foolist as $foo) { ?>
<li><?php echo $foo;?></li>
<?php } ?>
</ul>
[1] Try: php -r 'var_dump(get_defined_functions());' | less
- chrisseaton 10y agoBuilt-in functions are certainly a pain. They pose a similar problem for Ruby (which there is a Truffle implementation of). I think the best way around is to rewrite them in PHP, but it may not be tractable to do this with the same semantics. Another option is to run the C code that implements the builtins using the same JIT as you use for the PHP code. Then you can inline through the builtins, which is one reason why HHVM may be slow.