xref: /PHP-8.2/Zend/tests/enum/no-from.phpt (revision 269c8dac)
1--TEST--
2Enum no manual from method
3--FILE--
4<?php
5
6enum Foo: int {
7    case Bar = 0;
8
9    public static function from(string|int $value): self {
10        return $this;
11    }
12}
13
14?>
15--EXPECTF--
16Fatal error: Cannot redeclare Foo::from() in %s on line %d
17