This allows clients of a Command to inject logic by means of an anonymous function. This provides the flexibility to use custom logic in a command without subclassing a command, while still allowing the use of the command library. eg: $command = new Closure(function() {echo "hello world";}); $command->execute();//echoes 'hello world'
Author: Rolf Vreijdenberger
Inheritance: extends Command
 public function testClosureCommandMultipleArguments()
 {
     //multiple arguments for closure
     $output;
     $input = 5;
     $closure = function (&$output, $input) {
         $output = $input;
     };
     $command = new Closure($closure, array(&$output, $input));
     $this->assertNull($output);
     $command->execute();
     $this->assertEquals(5, $output);
 }