<?php
abstract class HiddenFactory
{
protected function __construct()
{
}
protected static function create()
{
}
}
class B extends HiddenFactory
{}
class A extends HiddenFactory
{
public function createB()
{
return B::create();
}
}
echo get_class(A::createB());
Fatal error: Uncaught Error: Non-static method A::createB() cannot be called statically in /in/RqoNT:27
Stack trace:
#0 {main}
thrown in /in/RqoNT on line 27
Process exited with code 255.
Deprecated: Non-static method A::createB() should not be called statically in /in/RqoNT on line 27
Warning: get_class() expects parameter 1 to be object, null given in /in/RqoNT on line 27
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: get_class() expects parameter 1 to be object, null given in /in/RqoNT on line 27
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
Deprecated: Non-static method A::createB() should not be called statically in /in/RqoNT on line 27
Warning: get_class() called without object from outside a class in /in/RqoNT on line 27
Strict Standards: Non-static method A::createB() should not be called statically in /in/RqoNT on line 27
Warning: get_class() called without object from outside a class in /in/RqoNT on line 27
Output for 5.3.0
Strict Standards: Non-static method A::createB() should not be called statically in /in/RqoNT on line 27
Warning: get_class() expects parameter 1 to be object, null given in /in/RqoNT on line 27