<?php
class target {
public function startCrawler()
{
echo 'crawler state';
}
}
class adapter {
private static $class = '';
public function __construct($classname)
{
self::$class = $classname;
}
public static function __callStatic($method,$args)
{
echo 'start memory / time tracking';
call_user_func(array(self::$class,$method),$args);
echo 'end memory / time tracking';
}
}
$obj = new adapter('target');
$obj::startCrawler();
start memory / time tracking
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method target::startCrawler() cannot be called statically in /in/Jumoq:19
Stack trace:
#0 /in/Jumoq(25): adapter::__callStatic('startCrawler', Array)
#1 {main}
thrown in /in/Jumoq on line 19
Process exited with code 255.
Output for 8.0.0 - 8.0.9
start memory / time tracking
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($function) must be a valid callback, non-static method target::startCrawler() cannot be called statically in /in/Jumoq:19
Stack trace:
#0 /in/Jumoq(25): adapter::__callStatic('startCrawler', Array)
#1 {main}
thrown in /in/Jumoq on line 19
Process exited with code 255.
start memory / time tracking
Deprecated: Non-static method target::startCrawler() should not be called statically in /in/Jumoq on line 19
crawler stateend memory / time tracking
Output for 7.3.32 - 7.3.33
start memory / time trackingcrawler stateend memory / time tracking
start memory / time tracking
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method target::startCrawler() should not be called statically in /in/Jumoq on line 19
crawler stateend memory / time tracking