<?php
class foo {
static public $params = [];
function init() {
self::$params['func'] = function () {
return 'yay';
};
}
}
class bar extends foo {
function __construct() {
parent::init();
echo parent::$params['func']();
}
}
new bar();
Notice: Undefined variable: params in /in/rt6FT on line 16
Fatal error: Function name must be a string in /in/rt6FT on line 16
Process exited with code 255.