summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug55554a.phpt
blob: b92a81f54f1525fbcf162f933e4e51e39a4caa6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Bug #55137 (Legacy constructor not registered for class)
--FILE--
<?php

// All constructors should be registered as such

trait TConstructor {
    public function constructor() {
        echo "ctor executed\n";
    }
}

class NewConstructor {
	use TConstructor {
	    constructor as __construct;
	}
}

class LegacyConstructor {
    use TConstructor {
        constructor as LegacyConstructor;
    }
}

echo "New constructor: ";
$o = new NewConstructor;

echo "Legacy constructor: ";
$o = new LegacyConstructor;

--EXPECT--
New constructor: ctor executed
Legacy constructor: ctor executed