mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
25 lines
393 B
PHP
25 lines
393 B
PHP
--TEST--
|
|
Enum cannot have properties, even via traits
|
|
--FILE--
|
|
<?php
|
|
|
|
trait Rectangle {
|
|
protected string $shape = "Rectangle";
|
|
|
|
public function shape(): string {
|
|
return $this->shape;
|
|
}
|
|
}
|
|
|
|
enum Suit {
|
|
use Rectangle;
|
|
|
|
case Hearts;
|
|
case Diamonds;
|
|
case Clubs;
|
|
case Spades;
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Enum Suit cannot include properties in %s on line %d
|