xref: /PHP-7.2/Zend/tests/traits/bug55554a.phpt (revision f1d7e3ca)
1--TEST--
2Bug #55137 (Legacy constructor not registered for class)
3--FILE--
4<?php
5
6// All constructors should be registered as such
7
8trait TConstructor {
9    public function constructor() {
10        echo "ctor executed\n";
11    }
12}
13
14class NewConstructor {
15	use TConstructor {
16	    constructor as __construct;
17	}
18}
19
20class LegacyConstructor {
21    use TConstructor {
22        constructor as LegacyConstructor;
23    }
24}
25
26echo "New constructor: ";
27$o = new NewConstructor;
28
29echo "Legacy constructor: ";
30$o = new LegacyConstructor;
31--EXPECT--
32New constructor: ctor executed
33Legacy constructor: ctor executed
34