summaryrefslogtreecommitdiff
path: root/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt
blob: f4d1e315fc808af6aa1a4102a37382c7d802cff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Subtype can add nullability to a parameter (contravariance)

--FILE--
<?php

interface A {
    function method(int $p);
}

class B implements A {
    function method(?int $p) { }
}

$b = new B();
$b->method(null);

--EXPECT--