Skip to content

Issue with empty() and properties #31

@koichirose

Description

@koichirose

I'm having trouble determining if an object has a property:

 if (!empty($deal->start_date)) {
echo $deal->start_date; //outputs nothing, does not enter the if
}

$start_date = $deal->start_date;

if (!empty($start_date)) {
echo $deal->start_date; //outputs the deal start date, enters the if
}  

What is going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions