Fix GH-9698: stream_wrapper_register crashes with FFI\CData #12926
Fix GH-9698: stream_wrapper_register crashes with FFI\CData #12926bukka wants to merge 1 commit intophp:PHP-8.2from
Conversation
…ed as class Closes phpGH-12926
3d783e8 to
8d8bef3
Compare
dstogov
left a comment
There was a problem hiding this comment.
The fix is right, but FFI\CData is not an unique class that disables instantiation through a fake constructor. It seems like all of them may be used in unexpected ways. (e.g. you fix only property update, but some code may try to read property first).
It would be great to find a common solution to disable instantiation of some classes (this is probably for master branch only).
|
So stream wrapper actually calls constructor but after adding the context property so we would probably need some sort of checks in functions that call |
|
Anyway I will merge this as it fixes the actual problem and it is applicable as a bug fix. |
The context is provided before constructor is called so there needs to be a bit more checking in FFI and stream user wrapper.