Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/9d6925e7bbce2e4d492d to your computer and use it in GitHub Desktop.
Save kirkegaard/9d6925e7bbce2e4d492d to your computer and use it in GitHub Desktop.
<?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