|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-12-30 04:43 UTC] david at grudl dot com
Description: ------------ ReflectionProperty::__toString() convert also value of property to string and it may fail, see https://3v4l.org/rfoGl Test script: --------------- <?php class A { public static $x; } A::$x = new stdClass; $rp = new ReflectionProperty('A', 'x'); echo $rp; Expected result: ---------------- Property [ public static $x ] Actual result: -------------- Fatal error: Uncaught Error: Object of class stdClass could not be converted to string PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
Fails during zval *default_value = property_get_default(prop); if (!Z_ISUNDEF_P(default_value)) { smart_str_appends(str, " = "); if (format_default_value(str, default_value, prop->ce) == FAILURE) { return; } } Apparently it's trying to get a default value but is actually coming up with the current value. https://3v4l.org/g4OLG