classes/phing/tasks/system/PhpEvalTask.php
protected function callFunction()
    {
        if ($this->class !== null) {
            // import the classname & unqualify it, if necessary
            $this->class = Phing::import($this->class);

            $user_func = [$this->class, $this->function];
            $h_func = $this->class . '::' . $this->function; // human-readable (for log)
        } else {
            $user_func = $this->function;
            $h_func = $user_func; // human-readable (for log)
        }

        // put parameters into simple array
        $params = [];
        foreach ($this->params as $p) {
            if ($p instanceof Parameter) {
                $value = $p->getParams();
                array_walk_recursive(
                    $value,
                    function (&$item) {
                        if ($item instanceof Parameter) {
                            $item = $item->getValue();
                        }
                    }
                );
                if ($value === null) {
                    continue;
                }
                $params[] = $value;
            } else {
                $params[] = $p->getValue();
            }
        }

        $this->log("Calling PHP function: " . $h_func . "()", $this->logLevel);
        foreach ($params as $p) {
            $this->log("  param: " . print_r($p, true), Project::MSG_VERBOSE);
        }

        $return = call_user_func_array($user_func, $params);

        if ($this->returnProperty !== null) {
            $this->project->setProperty($this->returnProperty, $return);
        }
    }
protected function callFunction()
    {
        if ($this->class !== null) {
            // import the classname & unqualify it, if necessary
            $this->class = Phing::import($this->class);

            $user_func = [$this->class, $this->function];
            $h_func = $this->class . '::' . $this->function; // human-readable (for log)
        } else {
            $user_func = $this->function;
            $h_func = $user_func; // human-readable (for log)
        }

        // put parameters into simple array
        $params = [];
        foreach ($this->params as $p) {
            if ($p instanceof Parameter) {
                $value = $p->getParams();
                array_walk_recursive(
                    $value,
                    function (&$item) {
                        if ($item instanceof Parameter) {
                            $item = $item->getValue();
                        }
                    }
                );
                if ($value === null) {
                    continue;
                }
                $params[] = $value;
            } else {
                $params[] = $p->getValue();
            }
        }

        $this->log("Calling PHP function: " . $h_func . "()", $this->logLevel);
        foreach ($params as $p) {
            $this->log("  param: " . print_r($p, true), Project::MSG_VERBOSE);
        }

        $return = call_user_func_array($user_func, $params);

        if ($this->returnProperty !== null) {
            $this->project->setProperty($this->returnProperty, $return);
        }
    }
protected function callFunction ( ) { if ( $ this -> class !== null ) { // import the classname & unqualify it, if necessary $ this -> class = Phing :: import ( $ this -> class ) ; $ user_func = [ $ this -> class , $ this -> function ] ; $ h_func = $ this -> class . '::' . $ this -> function ; // human-readable (for log) } else { $ user_func = $ this -> function ; $ h_func = $ user_func ; // human-readable (for log) } // put parameters into simple array $ params = [ ] ; foreach ( $ this -> params as $ p ) { if ( $ p instanceof Parameter ) { $ value = $ p -> getParams ( ) ; array_walk_recursive ( $ value , function ( & $ item ) { if ( $ item instanceof Parameter ) { $ item = $ item -> getValue ( ) ; } } ) ; if ( $ value === null ) { continue ; } $ params [ ] = $ value ; } else { $ params [ ] = $ p -> getValue ( ) ; } } $ this -> log ( "Calling PHP function: " . $ h_func . "()" , $ this -> logLevel ) ; foreach ( $ params as $ p ) { $ this -> log ( "  param: " . print_r ( $ p , true ) , Project :: MSG_VERBOSE ) ; } $ return = call_user_func_array ( $ user_func , $ params ) ; if ( $ this -> returnProperty !== null ) { $ this -> project -> setProperty ( $ this -> returnProperty , $ return ) ; } }
Calls function and returns results.

@return mixed
Calls function and returns results .