<?php
interface Foo {
public function testSelf(self $x);
public function testStatic(static $x);
}
class Bar1 implements Foo
{
public function testSelf(self $x) {}
public function testStatic(static $x) {}
}
class Bar2 implements Foo
{
public function testSelf(self $x) {}
public function testStatic(static $x) {}
}
$bar = new Bar1;
$bar->testStatic(new Bar2);
$bar->testSelf(new Bar2);