Just a quick rough-up of a proposal idea by @beausimensen@twitter.com for static return type hints in PHP.

Description:
gist.github.com/simensen/729c4

Implementation:
github.com/php/php-src/compare

There's probably a little extra work to be done to ensure covariance rules are respected, but this is a place to start discussion.

PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.