summaryrefslogtreecommitdiff
path: root/Zend/tests/nullable_types/covariant_nullable_param_fails.phpt
blob: 015f540ac083554bab649920f207ed621d437ad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--TEST--
Subtype cannot remove nullable parameter (covariance)
--FILE--
<?php

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

class B implements A {
    function method(int $p) { }
}
--EXPECTF--
Fatal error: Declaration of B::method(int $p) must be compatible with A::method(?int $p) in %s on line %d