If a value is specified, the previous token of the specified type(s)
containing the specified value will be returned.
Returns false if no token can be found.
public findPrevious ( integer | array $types, integer $start, integer $end = null, boolean $exclude = false, string $value = null, boolean $local = false ) : integer | boolean | ||
$types | integer | array | The type(s) of tokens to search for. |
$start | integer | The position to start searching from in the token stack. |
$end | integer | The end position to fail if no token is found. if not specified or null, end will default to the start of the token stack. |
$exclude | boolean | If true, find the previous token that are NOT of the types specified in $types. |
$value | string | The value that the token(s) must be equal to. If value is omitted, tokens with any value will be returned. |
$local | boolean | If true, tokens outside the current statement will not be checked. IE. checking will stop at the previous semi-colon found. |
return | integer | boolean |