summaryrefslogtreecommitdiff
path: root/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt
blob: a618ed207361d49a375e4f0f099a11c4acb26bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--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--