mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
21 lines
277 B
PHP
21 lines
277 B
PHP
--TEST--
|
|
Enum traits no __construct
|
|
--FILE--
|
|
<?php
|
|
|
|
trait Foo {
|
|
public function __construct() {
|
|
echo "Evil code\n";
|
|
}
|
|
}
|
|
|
|
enum Bar {
|
|
use Foo;
|
|
case Baz;
|
|
}
|
|
|
|
var_dump(Bar::Baz);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Enum may not include __construct in %s on line %d
|