source: src/router/php7/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 236 bytes
Line 
1--TEST--
2Subtype can add nullability to a parameter (contravariance)
3
4--FILE--
5<?php
6
7interface A {
8    function method(int $p);
9}
10
11class B implements A {
12    function method(?int $p) { }
13}
14
15$b = new B();
16$b->method(null);
17
18--EXPECT--
19
Note: See TracBrowser for help on using the repository browser.