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

function : PHP Fatal error: Only variables can be passed by reference #31

Closed
zaoqi-unsafe opened this issue Apr 29, 2019 · 1 comment
Closed

Comments

@zaoqi-unsafe
Copy link

PHP Fatal error:  Only variables can be passed by reference in /home/zaoqi/the-language/core/pure/php/lang.php on line 283

https://gitlab.com/the-language/the-language/blob/0cf321e1d779e37a602bee2417d2d302ce6d47ad/core/pure/typescript/lang.ts
结果

function list_to_jsArray($xs, &$k_done, &$k_tail) {     $ret = array();     while (construction_p($xs)) {         array_push($ret, construction_head($xs));         $xs = construction_tail($xs);     }     if (null_p($xs)) {         return k_done($ret);     }     return k_tail($ret, $xs); } function maybe_list_to_jsArray($xs) {     return list_to_jsArray($xs, function ($xs){     return $xs;     }, function ($xs, $x){     return false;     }); }
@zaoqi-unsafe
Copy link
Author

闭包本身不能直接按引用传递。

@cxtom cxtom closed this as completed in 0fbb69b May 5, 2019
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

1 participant