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

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

update php

File size: 296 bytes
Line 
1--TEST--
2Return type cannot add nullability (contravariance)
3
4--FILE--
5<?php
6
7interface A {
8    function method(): int;
9}
10
11interface B extends A {
12    function method(): ?int;
13}
14
15--EXPECTF--
16Fatal error: Declaration of B::method(): ?int must be compatible with A::method(): int in %s on line %d
17
Note: See TracBrowser for help on using the repository browser.