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'); Link to comment https://forums.phpfreaks.com/topic/83830-functional-programming/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.