<?php
interface Test
{
public function selfRef(self $other);
}
class TestImpl implements Test
{
public function selfRef(Test $other)
{
echo var_export($other, true) . PHP_EOL;
}
}
$a = new TestImpl();
$b = new TestImpl();
$a->selfRef($b);
Fatal error: Declaration of TestImpl::selfRef() must be compatible with Test::selfRef(self $other) in /in/Hb0Ye on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Declaration of TestImpl::selfRef() must be compatible with that of Test::selfRef() in /in/Hb0Ye on line 10
Process exited with code 255.