-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reduce arguments by reference #14
Comments
I'll suggest to open a issue for each idea so we could discuss over each one separately. Originally posted by @Maks3w at zendframework/zend-cache#8 (comment) |
@Maks3w I have changed the title and description on this PR. Will open new for the other ideas. Originally posted by @marc-mabe at zendframework/zend-cache#8 (comment) |
@marc-mabe Thanks. Tiny objectives make it more easy to be approved and merged. Originally posted by @Maks3w at zendframework/zend-cache#8 (comment) |
related to #67 Originally posted by @marc-mabe at zendframework/zend-cache#8 (comment) |
Fixed with #295 |
I had hoped that the fix for this (#295) would have fixed laminas/laminas-cache-storage-adapter-memory#5 as well but unfortunately it didn't. I think the main reason is that unlike the original zendframework/zend-cache#8, #295 did not remove/replace ArrayObject by array (zendframework/zend-cache@f3d9793). Shall I open a separate issue for that @boesing? |
The changes of #295 are just merged but there is no release yet, so ofc. it does not fix anything unless you somehow managed to consume the 4.0.x branch with a modified branch of the memory adapter on your own. Regarding replacement of The only way I could think of to handle this kind of thing would be to introduce dedicated event objects for every event. |
You're a funny guy... Of course I used the 4.0.x branch together with a version of the memory adapter with all the necessary signature changes applied for my test.
Oh dear... Well, I don't know any details of the design choices of this particular lib so I cannot comment on that. Just surprises me that this was part of the original PR and no-one seems to have objected that then.
I guess if I ever need to have the functionality in question fixed I'd rather try and find another PSR-16 implementation that works or write my own. Unfortunately I don't have the time to deep-dive into the constraints that are particular to this library, but I do understand that it covers much more than just my use case. |
Replacing Regarding the "initial PR" in question: that is almost 10 years old, I haven't spent a single second to dive into those changes. Since you already adapted some changes locally to have a compatible version with the recent 4.0.x branch, could you verify that once using |
I was unable to find a connection between the use of ArrayObject and the memory adapter issues. |
This PR reduces arguments by reference often used on internal methods.
It was previously done as performance improvement but in fact it decreases performance as PHP have to create a new zval and in some cases it needs to copy the value before PHP-7 as described here: http://nikic.github.io/2015/05/05/Internal-value-representation-in-PHP-7-part-1.html
Additionally arguments by reference make the code more error prone and hard to read.
Originally posted by @marc-mabe at zendframework/zend-cache#8
The text was updated successfully, but these errors were encountered: