ID:               43583
 Updated by:       [EMAIL PROTECTED]
 Reported By:      michael at dmgx dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Linux
 PHP Version:      5.2.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See also the previous comments. Everything else would be wrong.


Previous Comments:
------------------------------------------------------------------------

[2007-12-13 04:23:00] crrodriguez at suse dot de

you have to define __isset magic method.

------------------------------------------------------------------------

[2007-12-12 21:50:23] [EMAIL PROTECTED]

In PHP 5.3 it works fine.

------------------------------------------------------------------------

[2007-12-12 19:07:07] michael at dmgx dot com

Description:
------------
Empty returns false whenever a property of an object is accessed
through __get.  This problem has been reported before. The answer that
"it's a feature" is entirely bogus - Either return the right value or
throw a damn error but don't do nothing and leave people to wonder what
the Hell is going on with their script. I just lost two full days to
this "feature" and I'm not amused.

empty(someFunction());

throws an error.  If this bug is too much trouble to fix set it up so

empty($object->property);

also throws an error when a __get has been set.

Reproduce code:
---------------
class foo
{
        protected $data = array();
        public function __set($element, $value) { $this->data[$element] =
$value; }
        public function __get($element) { return $this->data[$element]; }
}

$bar = new foo();

$bar->cat = 'meow';

empty($bar->cat); // returns false, as expected.

$bar->cat = '';

empty($bar->cat); // returns false, should return true.




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43583&edit=1

Reply via email to