|
compact_echo
Daniel Barreiro
download
|
A simple example of a tree transformation plugin
This PHP-compiler plugin joins together several consecutive
echos into a single one and if any of the parameters to an echo
is a concatenation of strings it splits them and outputs them
separately. This is much faster than first concatenating
strings and then outputing the whole thing. For example, this:
<?php
echo "1" . (1 . $a ), 'ab';
echo 'c' ,2;
if ($a) {
echo 2;
//$a=1;
echo $a;
}
?>
is turned into this:
<?php
echo "1", 1, $a, "abc", 2;
if($a)
{
echo 2, $a;
}
?>
See comments in the source.
|