php-src/Zend/tests/traits/abstract_method_8.phpt
Nikita Popov cf7c68283d Fix treatment of "self" when validating against trait method
If we're validating a class method against a trait method, we need
to treat "self" in the trait method as the class where the method
is used. To achieve this, we need to thread the proto scope through
all methods, so it can be provided separately from proto.common->scope.
2020-04-23 11:41:34 +02:00

22 lines
263 B
PHP

--TEST--
Abstract method in trait using "self"
--FILE--
<?php
trait T {
abstract private function method(self $x): self;
}
class C {
use T;
private function method(self $x): self {
return $this;
}
}
?>
===DONE===
--EXPECT--
===DONE===