<?php
class Beer {
const NAME = 'Beer!';
public static function printed(){
echo 'static Beer:NAME = '. static::NAME . PHP_EOL;
}
}
class Ale extends Beer {
const NAME = 'Ale!';
public static function printed(){
forward_static_call(array('parent','printed'));
call_user_func(array('parent','printed'));
forward_static_call(array('Beer','printed'));
call_user_func(array('Beer','printed'));
}
public static function yeah() {
echo 'yeah!'.PHP_EOL;
}
}
Ale::printed();
echo 'ASDASD'. PHP_EOL;
$asd = new Ale();
call_user_func($asd, 'yeah');
Deprecated: Use of "parent" in callables is deprecated in /in/C7IQa on line 13
static Beer:NAME = Ale!
Deprecated: Use of "parent" in callables is deprecated in /in/C7IQa on line 14
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Beer!
ASDASD
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given in /in/C7IQa:27
Stack trace:
#0 {main}
thrown in /in/C7IQa on line 27
Process exited with code 255.
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.27
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Beer!
ASDASD
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given in /in/C7IQa:27
Stack trace:
#0 {main}
thrown in /in/C7IQa on line 27
Process exited with code 255.
Output for 8.0.0 - 8.0.9
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Beer!
ASDASD
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($function) must be a valid callback, no array or string given in /in/C7IQa:27
Stack trace:
#0 {main}
thrown in /in/C7IQa on line 27
Process exited with code 255.
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Ale!
static Beer:NAME = Beer!
ASDASD
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /in/C7IQa on line 27