<?php
abstract class EventSourcedEntity {
protected function test()
{
echo 'this';
}
}
abstract class AggregateRoot {
protected function test() {
parent::test();
echo 'works';
}
}
class Game extends AggregateRoot {
public function __construct(Member $member) {
$member->test();
}
}
class Member extends EventSourcedEntity {
}
$member = new Member();
new Game($member);
Fatal error: Cannot use "parent" when current class scope has no parent in /in/XrvsE on line 12
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Cannot use "parent" when current class scope has no parent in /in/XrvsE on line 12
Fatal error: Uncaught Error: Call to protected method EventSourcedEntity::test() from context 'Game' in /in/XrvsE:19
Stack trace:
#0 /in/XrvsE(28): Game->__construct(Object(Member))
#1 {main}
thrown in /in/XrvsE on line 19
Process exited with code 255.
Fatal error: Uncaught Error: Call to protected method EventSourcedEntity::test() from context 'Game' in /in/XrvsE:19
Stack trace:
#0 /in/XrvsE(28): Game->__construct(Object(Member))
#1 {main}
thrown in /in/XrvsE on line 19
Process exited with code 255.