Lisphp_Program::execute PHP Method

execute() public method

public execute ( Lisphp_Scope $scope )
$scope Lisphp_Scope
    public function execute(Lisphp_Scope $scope)
    {
        $value = null;
        foreach ($this->forms as $form) {
            $value = $form->evaluate($scope);
        }
        return $value;
    }

Usage Example

Example #1
0
 public function testFromFile()
 {
     $testFiles = glob(__DIR__ . '/Functional/*.lisphp');
     foreach ($testFiles as $file) {
         $code = file_get_contents($file);
         $scope = Lisphp_Environment::workflow();
         $program = new Lisphp_Program($code);
         $result = $program->execute($scope);
         $expected = file_get_contents(preg_replace('/\\.lisphp$/', '.out', $file));
         $this->assertSame(trim($expected), trim($result));
     }
 }
All Usage Examples Of Lisphp_Program::execute