summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/noctor001.phpt
blob: 19fe8dbd0d44d1b187f260007228d2c647c8da13 (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
--TEST--
Don't mark trait methods as constructor
--FILE--
<?php
trait Foo {
    public function Foo() {
    }
}

class Bar {
    use Foo;
    public function Bar() {
    }
}

$rfoofoo = new ReflectionMethod('Foo::Foo');
var_dump($rfoofoo->isConstructor());

$rbarfoo = new ReflectionMethod('Bar::Foo');
var_dump($rbarfoo->isConstructor());

$rbarbar = new ReflectionMethod('Bar::Bar');
var_dump($rbarbar->isConstructor());
?>
--EXPECTF--
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Bar has a deprecated constructor in %s on line %d
bool(false)
bool(false)
bool(true)