keenlearner Posted December 31, 2007 Share Posted December 31, 2007 I need to do a few functional programming in PHP, here is the code but it only prints out "arg2" but not "arg1". Thank you. function prints($arg1, $arg2) { echo $arg1. $arg2; } function applyOne($arg1) { $f = create_function('$arg2', 'return prints("$arg1", $arg2);'); return $f; } $printFunction = applyOne("arg1"); $printFunction('arg2'); Quote Link to comment https://forums.phpfreaks.com/topic/83830-functional-programming/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.