Skip to content
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

Runtime Notice for variable by &$reference #2

Closed
bartrail opened this issue Jul 20, 2011 · 4 comments
Closed

Runtime Notice for variable by &$reference #2

bartrail opened this issue Jul 20, 2011 · 4 comments

Comments

@bartrail
Copy link
Contributor

Thanks again for these beautiful maths!

I got into trouble with a strict PHP configuration, saying "Runtime Notice: Only variables should be assigned by reference in /home/con/www/lab/Moserware/Skills/HashMap.php line 36 "

When I disable the strict mode (or at least disable notices in php's error_reporting()) it works and I get a calculation. Unfortunately, I need the strict mode and all notices for the development to easier find bugs and the framework I'm using (Symfony2) even throws full Exceptions on notices (thanks to xdebug) so I can't even ignore a notice, even though I'd like to.

So I was trying to get rid of all ampersands as I don't fully understand the php 5.3 runtime notice for references - thought anything is a reference by now.. - seems it is not.. so unfortunately I broke the whole environment and some unit tests are totally going nuts..

Maybe you find some time to take a look over this, this is the commit where I radiacally (blindly, but not search & replace ;) removed the ampersands
bartrail@c61ca4e

and this is one of the tests that failed and I was trying to manually find out which else is failing in this TwoTeam Test case (came out this was it) - so I revered the unit test values in my fork back to the original ones, but maybe this can help you to locate which ampersand &reference is really needed...
bartrail@389665e

Cheers,
Conrad

@moserware
Copy link
Owner

Thanks for the info. I probably won't get a chance to look at it for quite some time, but if you resolve the issues I'd be happy to pull in the change.

@bartrail
Copy link
Contributor Author

Alright :) I'll let you know once I've made progress on this

@bartrail
Copy link
Contributor Author

I digged a bit more and found only a few lines where the references actually throw errors on runtime. Unfortunately phpunit isn't so error-greedy..

I started a new branch for the strict env php5.3 which I included into my project and keep up-to-date when I run into any new error.. all unit tests are still successful. When my project is finished in the next couple of weeks I will send back the pull request with the updated version.

@Zn4rK
Copy link
Collaborator

Zn4rK commented May 31, 2016

This should be solved by #12

Feel free to reopen this issue if you still are experiencing problems!

@Zn4rK Zn4rK closed this as completed May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants