summaryrefslogtreecommitdiff
path: root/Zend/tests/traits
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2010-05-29 20:01:08 +0000
committerJohannes Schlüter <johannes@php.net>2010-05-29 20:01:08 +0000
commit0262fdf3e92cc6b4287bffc70bd104d3da9c3c07 (patch)
treec41baf9532bfb3d09604e3fe81b4a1547c300cc2 /Zend/tests/traits
parentbc4c3fdd838a9aeec1a34306439675df71c8d357 (diff)
downloadphp-git-0262fdf3e92cc6b4287bffc70bd104d3da9c3c07.tar.gz
- A method called like a trait is no constructor
Diffstat (limited to 'Zend/tests/traits')
-rw-r--r--Zend/tests/traits/noctor001.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Zend/tests/traits/noctor001.phpt b/Zend/tests/traits/noctor001.phpt
new file mode 100644
index 0000000000..d15acff87a
--- /dev/null
+++ b/Zend/tests/traits/noctor001.phpt
@@ -0,0 +1,28 @@
+--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());
+?>
+--EXPECT--
+bool(false)
+bool(false)
+bool(true)