symfony/symfony — pull request #10669 by stloyd (2014-04-09 16:24:20+00:00)
Title: [Profiler] Prevent throwing fatal errors when searching timestamps or invalid dates

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT

There is one question about this fix, in overall there are 2 approaches, actual one in PR, and second:

```php
if ('' != $start && null !== $start) {
try {
// $start can already contain timestamp
$start = new \DateTime(is_numeric($start) ? '@'.$start : $start);
$start = $start->getTimestamp();
} catch (\Exception $e) {
$start = null;
}
} else {
$start = null;
}

if ('' != $end && null !== $end) {
try {
// $end can already contain timestamp
$end = new \DateTime(is_numeric($end) ? '@'.$end : $end);
$end = $end->getTimestamp();
} catch (\Exception $e) {
$end = null;
}
} else {
$end = null;
}