<?php
$m->type = 'EVENT';
if (empty($m->type)) {
var_dump($m->type);
}
?>
This piece of code prints
string(5) "EVENT"
How is this possible?
edit
The $m object is a plain one, with magic __set and __get that store values into a protected array.
<?php
$m->type = 'EVENT';
if ($m->type == NULL) {
var_dump($m->type);
}
?>
The above mentioned code works as expected (it skips the if body).
$someVar=$m->type; if (empty($someVar)) { var_dump($m->type); }and tell us, what you get$m? (ie: what class?) This doesn't happen with astdClass, so the type of$mis probably a pretty big factor.