summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/rfc004.phpt
blob: abd12c1e9016876258c79cf9b242d407a03c5faf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
RFC example: missing return type on override
--FILE--
<?php

class User {}

interface UserGateway {
    function find($id) : User;
}

class UserGateway_MySql implements UserGateway {
    // must return User or subtype of User
    function find($id) {
        return new User;
    }
}
?>
--EXPECTF--
Fatal error: Declaration of UserGateway_MySql::find($id) must be compatible with UserGateway::find($id): User in %s on line 11