B.26 PhpEvalTask
Prev | Appendix B. Core tasks | Next

## B.26 PhpEvalTask

With the `PhpEvalTask`, you can set a property to the results of evaluating a PHP expression or the result returned by a function/method call.

Table B.27: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`function` | `String` | The name of the Property. | n/a | One of these is required.
`expression` | `String` | The expression to evaluate. | n/a
`class` | `String` | The static class which contains function. | n/a | No
`returnProperty` | `String` | The name of the property to set with result of expression or function call. Note: if this attribute is set, the expression must return a value. | n/a | No
`level` | `String` | Control the level at which php reports status messages. One of `error`, `warning`, `info`, `verbose`, `debug`. | `info` | No

### B.26.1 Examples

    <php function="crypt" returnProperty="enc_passwd">
      <param value="${auth.root_passwd}"/>
    </php>

    <php expression="3 + 4" returnProperty="sum"/>

    <php expression="echo 'test';">

### B.26.2 Supported Nested Tags

- `param`

Prev | Up | Next
B.25 PhingCallTask | Home | B.27 PropertyTask