xref: /PHP-7.3/Zend/tests/traits/bug55554d.phpt (revision b746e698)
1--TEST--
2Bug #55137 (Legacy constructor not registered for class)
3--FILE--
4<?php
5
6// Test mixed constructors from different traits, we are more strict about
7// these cases, since that can lead to un-expected behavior.
8// It is not consistent with the normal constructor handling, but
9// here we have a chance to be more strict for the new traits.
10
11trait TNew {
12    public function __construct() {
13        echo "TNew executed\n";
14    }
15}
16
17trait TLegacy {
18    public function ReportCollision() {
19        echo "ReportCollision executed\n";
20    }
21}
22
23class ReportCollision {
24    use TNew, TLegacy;
25}
26
27$o = new ReportCollision;
28--EXPECTF--
29Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d
30