Yes ,its possible but you need to use $this keyword unless function is global and outside any class.
class Foo
{
public $bars = array();
public function __construct($string)
{
$this->fetchBars($string);
myfunction(); // this can be called without $this
}
public function fetchBars($string)
{
$folder = opendir($string);
while (false !== ($bar = readdir($folder)))
{
$this->bars[] = $bar;
}
closedir($folder);
}
}
// this function is outside class. so can be used without $this.
function myfunction()
{
echo "foo";
}