Re: [PHP-DEV] Inconsistency in enumerations RFC

2021-03-17 Thread Marc
On 17.03.21 09:36, Ilija Tovilo wrote: Hi Marc I think it would be much clearer if there would be two different interfaces like: ``` interface IntEnum extends UnitEnum { public int $value; public static function from(int$value): static; public static function tryFrom(int$value): ?static; } in

Re: [PHP-DEV] Inconsistency in enumerations RFC

2021-03-17 Thread Ilija Tovilo
Hi Marc > >> I think it would > >> be much clearer if there would be two different interfaces like: > >> ``` interface IntEnum extends UnitEnum { public int $value; public > >> static function from(int$value): static; public static function > >> tryFrom(int$value): ?static; } > >> interface String

Re: [PHP-DEV] Inconsistency in enumerations RFC

2021-03-15 Thread Marc
Hi Ilija - thanks for your answers On 14.03.21 23:18, Ilija Tovilo wrote: Hi Marc Thanks for testing the enum feature. Hi I'm trying out the new enumeration support for PHP 8.1 using https://github.com/php/php-src/pull/6489 thought to implement a polyfill based on class constants and reflecti

Re: [PHP-DEV] Inconsistency in enumerations RFC

2021-03-14 Thread Ilija Tovilo
Hi Marc Thanks for testing the enum feature. > Hi I'm trying out the new enumeration support for PHP 8.1 using > https://github.com/php/php-src/pull/6489 thought to implement a polyfill > based on class constants and reflection. Doing so I come across the > newly defined interfaces: > ``` interfa