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

ByRef variables #4

Closed
nicolasrod opened this issue May 27, 2020 · 0 comments
Closed

ByRef variables #4

nicolasrod opened this issue May 27, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@nicolasrod
Copy link
Owner

nicolasrod commented May 27, 2020

Take into account variables by reference. The following code:

<?php declare(strict_types=1);

function test(int &$num) {
    $num = 23;
}

$v = 44;
test($v);
echo $v;

Should be translated into:

def test(num_):
   test.num_ = num_
   test.num_ = 23

v = 44
test(v)
v = test.num_
print(v)
@nicolasrod nicolasrod added the enhancement New feature or request label May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant