Open DanielEScherzer opened 2 hours ago
There is an existing test ReflectionConstant_double_construct.phpt
that ensures this isn't a problem for the ReflectionConstant class - maybe we should add one for each class?
There is an existing test
ReflectionConstant_double_construct.phpt
that ensures this isn't a problem for the ReflectionConstant class - maybe we should add one for each class?
Probably yes. If you want to write the tests and give this a shot, go ahead :)
A related issue came up not that long ago (maybe @iluuu1994 remembers). We should consider to forbid calling constructors manually (and probably extend this to all magic methods). Any ->__*()
is doing it wrong, in my opinion.
I found this in a number of other classes in other extensions as well, should I file a dedicated task for each?
It doesn't matter too much how we keep track of it. Separate issue for reflection vs spl is perhaps a bit cleaner.
It doesn't matter too much how we keep track of it. Separate issue for reflection vs spl is perhaps a bit cleaner.
Okay, filed #16604
Description
The following code:
Resulted in this output:
But I expected this output instead:
Also tested and have a memory leak:
PHP Version
8.5-dev
Operating System
No response