Home | Downloads | Documentation | Plugins | Spinoff Projects | Mailing List

Plugins

The plugins on this page are “3rdparty” plugins contributed by others. They are distributed in source form, and must be compiled using the phc_compile_plugin script distributed with phc. If you want your own plugin to be added to this list, please contact us on the mailing list.

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.

License: whichever applies to the PHP Compiler
$LastChangedDate: 2006-09-08 12:24:58 +0100 (Fri, 08 Sep 2006) $. Contents © the authors.