PHP:如何从父类调用子类的函数
2022-08-30 08:37:13
如何从父类调用子类的函数?请考虑以下情况:
class whale
{
function __construct()
{
// some code here
}
function myfunc()
{
// how do i call the "test" function of fish class here??
}
}
class fish extends whale
{
function __construct()
{
parent::construct();
}
function test()
{
echo "So you managed to call me !!";
}
}