fabpot/Twig — pull request #522 by shvchk (2011-11-20 09:09:16+00:00)
Title: Support of negative timestamps

Date could be checked against this condition, as proposed in my patch:

```
ctype_digit((string) $date)
|| (('-' === $date[0])
&& (ctype_digit(substr($date, 1))))
```
or this:

```
preg_match('/^\-?\d+/', $date)
```
Second is maybe more readable, but 20% slower.