Skip to content

Instantly share code, notes, and snippets.

@lloc
Created March 22, 2018 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lloc/0c746eb200b499f935b5db5c25de76f3 to your computer and use it in GitHub Desktop.
Save lloc/0c746eb200b499f935b5db5c25de76f3 to your computer and use it in GitHub Desktop.
<?php
abstract class aFoo {
abstract function baz( int $foobar );
}
abstract class aBar extends aFoo {
// expected type of foobar is still int
abstract function baz( $foobar ) : int;
}
interface iFoo {
public function bar( array $foobar ): Bar;
}
class Bar { }
class Baz implements iFoo {
public function bar( $foobar ): Bar { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment