An open API service indexing awesome lists of open source software.

https://github.com/jordanrl/never-argument-type


https://github.com/jordanrl/never-argument-type

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

# PHP RFC: Never For Parameter Types

**THIS DOCUMENT HAS BEEN RETIRED. SEE THE FULL RFC: https://wiki.php.net/rfc/never_for_parameter_types**

## Introduction

Arguments in PHP are [contravariant](https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)) to preserve Liskov substitution. This means that if class B extends class A, then redefines a function call, the entire type of that argument from class A must be present in the type of the argument in class B:

```php