Needs review
Project:
Markdown
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2026 at 12:44 UTC
Updated:
15 Oct 2026 at 06:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lars.stiebenz commentedThe method of interest looks like this.
As a workaround, you can convert the object to an array with get_object_vars():
Maybe someone with a better understanding of the use cases for the Iterator has a more elegant approach to fix this.
Comment #3
lars.stiebenz commentedThis patch is for those, who want to use the workaround for now.
Comment #6
orkutmuratyilmazThanks @lars.stiebenz for reporting this and for the workaround in #2/#3, it pointed straight at the cause.
I opened MR !66 with a slightly different fix. Called from inside the class,
get_object_vars($this)also returns protected and private properties (class,provider,_deprecated, ...), anddoMerge()then copies them from one definition to another. The MR reads the properties from a closure with no class scope instead, so the iterator still returns only the public properties, in the same order as before.The new
AnnotationObjectTestcovers both points: iterating triggers no deprecation, and only the public properties are returned. On a PHP 8.5 site, the 35 rebuilt plugin definitions are identical with and without the change.