xref: /PHP-7.4/Zend/tests/traits/bug60217b.phpt (revision d679f022)
1--TEST--
2Bug #60217 (Requiring the same method from different traits and abstract methods have to be compatible)
3--FILE--
4<?php
5
6trait TBroken1 {
7    public abstract function foo($a);
8}
9
10trait TBroken2 {
11    public abstract function foo($a, $b = 0);
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--EXPECTF--
25Fatal error: Declaration of TBroken1::foo($a) must be compatible with TBroken2::foo($a, $b = 0) in %s
26