|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-15 04:20 UTC] amt@php.net
[2004-07-15 14:33 UTC] jbeall at heraldic dot us
[2004-07-15 17:51 UTC] amt@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ If you define a property as public, and then also define the __get() and __set() functions within the same class, those functions are not called. Reproduce code: --------------- class Sub { public $someProp; function __get($prop) { echo "Property $prop called\n"; } function __set($prop, $val) { echo "Property $prop set to $val\n"; } } $foo = new Sub(); $foo->someProp = 10; echo $foo->someProp; Expected result: ---------------- Property someProp set to 10 Property someProp called Actual result: -------------- 10