I have an issue with my IF-statement, apparently.
Inside a symfony2 controller I have the following PHP:
foreach($all as $t) {
if ( ($end == null) || ($t->getDate()->format('Y-m-d') <= $end->format("Y-m-d")) ) {
if ( ($start == null) || ($t->getDate()->format('Y-m-d') >= $start->format("Y-m-d")) ) {
$subset[] = $t;
}
}
}
I get this for an error message:
FatalErrorException: Error: Call to undefined function App\Bundle\Controller\ () in www/App/src/App/Bundle/Controller/TransactionController.php line 59
So somewhere in my if statement it tries to run a sym2 controller? I am lost...
both $start and $end are valid dateTime objects, so are each $date on the $t objects.
If I comment the second IF-statement out like this, it runs without errors.
foreach($all as $t) {
if ( ($end == null) || ($t->getDate()->format('Y-m-d') <= $end->format("Y-m-d")) ) {
/*
if ( ($start == null) || ($t->getDate()->format('Y-m-d') >= $start->format("Y-m-d")) ) {
$subset[] = $t;
}
*/
}
}
Addition: Line 59 which the error points to is the line where the second if statement condition is stated.
Aucun commentaire:
Enregistrer un commentaire