Created
October 13, 2011 16:52
-
-
Save emjayess/1284774 to your computer and use it in GitHub Desktop.
anonymous function using arguments with parent fn's variables
This file contains hidden or 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
public function parentFn($argVar) { | |
$decVar = 0.00; | |
$callback = function ($anonVar) use ($argVar, &$decVar) { | |
$result += ($decVar * $anonVar) * ($argVar); | |
}; | |
return round($result, 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment