Created
November 19, 2017 01:26
-
-
Save mk-pmb/7ecc18f81c08abebe78a573b416b0e0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$f = function ($a) { | |
return function ($b) use ($a) { return $a + $b; }; | |
}; | |
$g = $f(2); | |
$x = $g(3); | |
var_dump($x); # 5 | |
# $y = $f(2)(3); # syntax error, unexpected '(' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment