Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
task question
  • Hi,

    I create tasks always with "public static function", but when I see example code it seems to be declared as "public function"

    What should I use? Or doesn't it matter? It works both ways btw...
  • HarroHarro
    Accepted Answer
    The run() method in Refine does:

    $return = call_fuel_func_array(array($new_task, $method), $args));

    Which means it should not be static, and you'll get a message from 5.6 onwards:

    "Methods called from an incompatible context are now deprecated, and will
    generate E_DEPRECATED errors when invoked instead of
    E_STRICT. Support for these calls will be removed in
    a future version of PHP."

    This is true the other way around too, you can not call a non-static method statically anymore.
  • aah ok... good to know.. thanks

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion