|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-27 08:31 UTC] derick@php.net
[2004-04-27 08:42 UTC] amt@php.net
[2004-04-27 17:30 UTC] benjcarson at digitaljunkies dot ca
[2004-05-10 03:15 UTC] helly@php.net
[2006-04-03 12:43 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 05:00:02 2025 UTC |
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)