Skip to content

Commit bd42e50

Browse files
committed
Test __construct in enum from trait
1 parent 51e0e6a commit bd42e50

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Enum traits no __construct
3+
--FILE--
4+
<?php
5+
6+
trait Foo {
7+
public function __construct() {
8+
echo "Evil code\n";
9+
}
10+
}
11+
12+
enum Bar {
13+
use Foo;
14+
case Baz;
15+
}
16+
17+
var_dump(Bar::Baz);
18+
19+
?>
20+
--EXPECTF--
21+
Fatal error: Enum may not include __construct in %s on line %d

0 commit comments

Comments
 (0)