-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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 chained call #301
Conversation
the invalid free one has been fixed in 98a36c8 |
👍 Also consider this syntax:
|
invalid reads and invliad free must be fixed.. |
On windows all tests pass for me, mazeltov! :) |
@weltling thanks :) |
Will this allow for immediately calling closures from require/include calls as well? Something like this: <?php
// getItem.php
return function(MongoDB $db) {
return function($name) use($db) {
return $db->findOne(['name' => $name]);
};
};
?>
<?php
// test.php
$db = (new Mongo())->myDatabase;
$getItem = (require 'getItem.php')($db); // This is the the line relevant to the question
$item = $getItem('test');
?> |
@nubs Yes. |
Awesome, I wasn't sure if this would apply to a language construct or not, glad to hear that it would. |
Good job guys, have you already written a RFC and proposed it? |
Nope, since this PR is based on @nikic 's , I assume he will write a RFC. then I will merge this PR into his proposal :) |
What happened to this amazing feature? |
hmmm, I closed it by accident..... .:< |
Conflicts: Zend/zend_vm_execute.h
close this as it will be implemented in uniform variable style by @nikic |
This will allow such syntax:
this patch is refactored, in order to based on the @nikic 's instance call one(#291). maybe we can merge them together..
btw: there are some invalid reads report while run with valgrind,, but it seems introduces by nikic's patch,
I will keep looking them.