empty() behavior

Posted by lightalloy on Stack Overflow See other posts from Stack Overflow or by lightalloy
Published on 2010-04-27T07:32:51Z Indexed on 2010/04/27 7:43 UTC
Read the original article Hit count: 269

Filed under:
|
|

Maybe I'm asking a stupid question, but I can't understand this behavior:

<?php
    $this->meeting->google_id = 'test';
    $test = $this->meeting->google_id;
    var_dump(empty($test));
    var_dump(empty($this->meeting));
    var_dump(empty($this->meeting->google_id));
?>

gives output:

bool(false) bool(false) bool(true) 

Why the result of empty($this->meeting->google_id); is true? And how should I check this property then?

© Stack Overflow or respective owner

Related posts about php

Related posts about empty