PHP performance considerations of passing variable into a function
Having (1)

public function execute(array $fooArray)
{
    foreach ($fooArray as $foo) {
        echo $foo . ":" . $this-&gt;checkBar($foo, $this-&gt;getBar()) . " ";
    }
}

public function checkBar($foo, array $fooCheck)
{
    return in_array($foo, $fooCheck);
}


is the exact same thing (performance wise) as (2)

public function execute(array $fooArray)
{
    foreach ($fooArray as $foo) {
        echo $foo . ":" . $this-&gt;checkBar($foo) . " ";
    }
}

public function checkBar($foo)
{
    return in_array($foo, $this-&gt;getBar());
}


In example (1), if you needed checkBar() to handle several different array inputs, then you would be able to differentiate them in execute(). Whereas example (2) would be better if you knew you would only be checking against a single array.

It's easier to expand code that's written like example (1).