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

php - use return statement instead of assignment #58

Closed
jacekkarczmarczyk opened this issue Dec 8, 2021 · 5 comments
Closed

php - use return statement instead of assignment #58

jacekkarczmarczyk opened this issue Dec 8, 2021 · 5 comments
Assignees

Comments

@jacekkarczmarczyk
Copy link

Hopefully code samples explain all ;)

Current

require '...../world.php'; // $world = [...]

// where the heck the $world variable is coming from? phpstan/psalm/editor complains about undefined variable
print_r($world); 

Proposal

$world = require '...../world.php'; // return [...]

// all is well
print_r($world); 
@stefangabos stefangabos self-assigned this Dec 8, 2021
@stefangabos
Copy link
Owner

i'll think about it and see what the best solution is
thank you!

@stefangabos
Copy link
Owner

This is now done
$world = require '...../world.php'; now works as you'd expect.
Thanks for suggesting this!

@jacekkarczmarczyk
Copy link
Author

jacekkarczmarczyk commented Feb 8, 2022

it seems that this change is not included in 2.4.0 release although the README is already updated to the new format?

EDIT: nvm, I've just seen 2.5.0 in changelog

@stefangabos
Copy link
Owner

i haven't done a release yet containing the change - you'll have to download latest by clicking on the green "Code" button and then choosing "Download as ZIP".
I am making some updates these days and I'll probably make a release next week

@stefangabos
Copy link
Owner

I forgot to add your name to the changelog - i just fixed that. thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants