Skip to content

Instantly share code, notes, and snippets.

@kirkegaard kirkegaard/anonfunc.php
Last active Aug 29, 2015

Embed
What would you like to do?
<?php
class myObj
{
public function a($args1)
{
return function($args2) use ($args1) {
return array_merge($args1, $args2);
};
}
}
$o1 = new myObj();
$o2 = $o1->a(array('a'));
var_dump($o2(array('b')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.