Skip to content

Instantly share code, notes, and snippets.

@uzulla
Created April 3, 2014 14:07
Show Gist options
  • Save uzulla/9955024 to your computer and use it in GitHub Desktop.
Save uzulla/9955024 to your computer and use it in GitHub Desktop.
<?php
$foo = 'ふー';
$bar = 'ばー';
$func1 = generate($foo,$bar);
// $app->get($key, generate($foo, $bar));
$foo = "FOOO!!!";
$func2 = generate($foo,$bar);
$func1();
$func2();
function generate($foo, $bar){
return function () use ($foo, $bar){
echo $foo;
echo $bar;
echo PHP_EOL;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment