reference stationary slight php?
in php, i am means normal duty non-static but problem, nonetheless i haven't figured out stationary method. am i only blank right syntax, possible?
(edit: initial suggested answer does seem work. i've extended instance arrangement errors returned.)
function foo1($a,$b) { relapse $a/$b; }
class bar
{
stationary duty foo2($a,$b) { relapse $a/$b; }
open duty usereferences()
{
// works fine:
$fn = foo1;
imitation $fn(1,1);
// works fine:
imitation self::foo2(2,1);
imitation bar::foo2(3,1);
// does work ... error: capricious category consistent 'foo2'
//$fn = self::foo2;
//print $fn(4,1);
// does work ... error: capricious duty self::foo2()
//$fn = 'self::foo2';
//print $fn(5,1);
// does work ... error: capricious duty bar::foo2()
//$fn = 'bar::foo2';
//print $fn(5,1);
}
}
$x = new bar();
$x->usereferences();
(i am controlling php v5.2.6 -- does answer change depending chronicle too?)
Comments
Post a Comment