<cake:nocache>
<?php $barfoo = 'in sub2'; ?>
<?php echo $barfoo; ?>
</cake:nocache>
<?php echo 'printing: "' . $barfoo . '"'; ?>