xref: /PHP-7.1/Zend/tests/bug62441.phpt (revision 113213f0)
1--TEST--
2Bug #62441: Incorrect strong typing in namespaced child classes
3--FILE--
4<?php
5namespace {
6    interface Iface {
7        function method(stdClass $o);
8    }
9}
10namespace ns {
11    class Foo implements \Iface {
12        function method(stdClass $o) { }
13    }
14
15    (new Foo)->method(new \stdClass);
16}
17?>
18--EXPECTF--
19Fatal error: Declaration of ns\Foo::method(ns\stdClass $o) must be compatible with Iface::method(stdClass $o) in %s on line %d
20