mirror of
https://github.com/php/php-src.git
synced 2026-04-14 19:41:05 +02:00
RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
17 lines
251 B
PHP
17 lines
251 B
PHP
--TEST--
|
|
Enum no manual from method
|
|
--FILE--
|
|
<?php
|
|
|
|
enum Foo: int {
|
|
case Bar = 0;
|
|
|
|
public static function from(string|int $value): self {
|
|
return $this;
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot redeclare Foo::from() in %s on line %d
|