Skip to content

Instantly share code, notes, and snippets.

@qRoC
Created May 16, 2018 11:28
Show Gist options
  • Save qRoC/b3a34012dc3baa7e3791b8b00015d599 to your computer and use it in GitHub Desktop.
Save qRoC/b3a34012dc3baa7e3791b8b00015d599 to your computer and use it in GitHub Desktop.
typehint parent bug PHP 7.2
<?php
interface ITest {
public function test(self $test): void;
}
class TestBase implements ITest {
// all ok
public function test(parent $test): void {
}
}
class Test2 extends TestBase {
// error
//public function test(ITest $test): void {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment