Seditio Source
Root |
./othercms/croogo-4.0.7/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Functions/ClosureDeclarationUnitTest.inc
<?php
namespace Beakman;

class TraitUser
{

    use FunctionsTrait;

    /**
     * [doThing description]
     *
     * @param callable $callback The description.
     * @return void
     */
    public function doThing(callable $callback)
    {
        $visitor = function($expression) use (&$visitor, $callback) {
            echo 'It fails';
        };
        $visitor = function ($expression)use(&$visitor, $callback) {
            echo 'It works';
        };
        $visitor($this);
    }
}

$foo = 'bar';
$bar = 'foo';

$zum = function()use ($foo, $bar) {
    return $foo;
};

$zum = function ()use ($foo, $bar) {
    return $foo;
};