xref: /PHP-8.2/Zend/tests/traits/bug60217c.phpt (revision 7aacc705)
1--TEST--
2Bug #60217 (Requiring the same method from different traits and abstract methods have to be compatible, in both directions.)
3--FILE--
4<?php
5
6trait TBroken1 {
7    public abstract function foo($a, $b = 0);
8}
9
10trait TBroken2 {
11    public abstract function foo($a);
12}
13
14class CBroken {
15    use TBroken1, TBroken2;
16
17    public function foo($a) {
18        echo 'FOO';
19    }
20}
21
22$o = new CBroken;
23$o->foo(1);
24?>
25--EXPECTF--
26Fatal error: Declaration of CBroken::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d
27