|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-08-05 07:20 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2019-08-05 07:20 UTC] requinix@php.net
[2019-08-05 07:55 UTC] nikic@php.net
[2019-08-05 08:50 UTC] requinix@php.net
-Status: Not a bug
+Status: Duplicate
[2019-08-05 08:50 UTC] requinix@php.net
[2019-08-05 09:18 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 19:00:01 2025 UTC |
Description: ------------ When you use setting value via reflection on uninitialized property __set magic method will be called. If you remove type of property or set default value, __set method will not be called. Is it a bug? Because in RFC I have not seen anything about this behavior Test script: --------------- class Example { private string $test; public function __set($name, $value) { echo "$name=$value"; } } $t = new Example(); $property = new ReflectionProperty($t, 'test'); $property->setAccessible(true); $property->setValue($t, 'foo'); Expected result: ---------------- No __set is called Actual result: -------------- __set is called