Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Container{
- private $_test = array();
- public function test($test)
- {
- $closure = function($arg){
- return $this->_test['by_closure'] = $arg;
- };
- print_r($closure);
- return $closure($test);
- }
- }
- $container = new Container;
- $container->test(111);
- //Closure Object ( [this] => Container Object ( [_test:Container:private] => Array ( ) ) [parameter] => Array ( [$arg] => ) )
Advertisement
Add Comment
Please, Sign In to add comment