I\'m checking out some PHP 5.3.0
features and ran across some code on the site that looks quite funny:
public function getTotal($tax)
{
$tot
Until very recent years, PHP has defined its AST and PHP interpreter has isolated the parser from the evaluation part. During the time when the closure is introduced, PHP's parser is highly coupled with the evaluation.
Therefore when the closure was firstly introduced to PHP, the interpreter has no method to know which which variables will be used in the closure, because it is not parsed yet. So user has to pleased the zend engine by explicit import, doing the homework that zend should do.
This is the so-called simple way in PHP.