From: benjcarson at digitaljunkies dot ca
Operating system: Linux
PHP version: 5CVS-2004-04-27 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: isset() returns false for properties returned from __get()
Description:
------------
isset() returns false for variables that are returned using the __get()
method, even though the variables are set and their values are returned
properly.
Reproduce code:
---------------
<?php
class Foo { var $arr; function __get($var) { return $this->arr[$var]; } }
class Bar { var $var; function __get($tmp) { return $this->var; } }
$f = new Foo();
$f->arr["key"] = "val";
var_dump($f->key); // Value returned correctly
var_dump(isset($f->key)); // isset() disagrees
$b = new Bar();
$b->var = "blah";
var_dump($b->dummy); // Value returned correctly
var_dump(isset($b->dummy)); // isset() returns false
?>
Expected result:
----------------
string(3) "val"
bool(true)
string(4) "blah"
bool(true)
Actual result:
--------------
string(3) "val"
bool(false)
string(4) "blah"
bool(false)
--
Edit bug report at http://bugs.php.net/?id=28176&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28176&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28176&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28176&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28176&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28176&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28176&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28176&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28176&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28176&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28176&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28176&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28176&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28176&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28176&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28176&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28176&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28176&r=float