php-parser/test/code/prettyPrinter/stmt/enum.test
Tomas Votruba f68e1a43ff
[PHP 8.1] Add support for enums (#758)
RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-04-25 21:11:36 +02:00

39 lines
379 B
Plaintext

Enum
-----
<?php
enum A implements B
{
case X;
case Y;
public function foo() {}
}
enum B: int {
case X = 1;
case Y = 2;
}
enum C: string implements D {
case Z = 'A';
}
-----
!!php7
enum A implements B
{
case X;
case Y;
public function foo()
{
}
}
enum B
{
case X = 1;
case Y = 2;
}
enum C implements D
{
case Z = 'A';
}