Annotation of embedaddon/php/Zend/tests/traits/bug55554d.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #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:
11: trait TNew {
12: public function __construct() {
13: echo "TNew executed\n";
14: }
15: }
16:
17: trait TLegacy {
18: public function ReportCollision() {
19: echo "ReportCollision executed\n";
20: }
21: }
22:
23: class ReportCollision {
24: use TNew, TLegacy;
25: }
26:
27: $o = new ReportCollision;
28:
29: --EXPECTF--
30:
31: Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d
32:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>