xref: /php-src/Zend/tests/return_types/031.phpt (revision f8d79582)
1--TEST--
2Nullable return type inheritance rules (non-nullable and nullable)
3--FILE--
4<?php
5class A {
6    function foo(): int {}
7}
8class B extends A {
9    function foo(): ?int {}
10}
11?>
12DONE
13--EXPECTF--
14Fatal error: Declaration of B::foo(): ?int must be compatible with A::foo(): int in %s031.php on line 6
15