View Single Post
Old 09-10-2010, 10:56 PM  
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
foo::internal(); would work except for the fact that I really need $this because internal() normally use $this->properties...

I've oversimplified my example. Sorry.
This would be more accurate :

Quote:
class foo{
public $msg;

public function interne(){
print $msg;
}

public function __call($method, $args){
if(isset($this->$method)){
$func = $this->$method;
$func();
}
}
}

$f = new foo();
$f->msg = 'hello';
$f->bar = function () {foo::interne();};
$f->bar();
foo::interne(); won't 'know' that $f->msg has been set...

I also tryed call_user_func_array(array($f, 'bar'), array()); instead of $f->bar without success

Thanks for you help... specially at this hour.
__________________
I have nothing to advertise ... yet.

Last edited by qw12er; 09-10-2010 at 11:05 PM..
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote