In the light of this, maybe enums (assuming this feature comes first)
should be implemented as immutable objects rather than values?

Type-checking for enums would be important, so in PHP terms, an enum
"instance" would likely be closer to an object than a value in nature
anyway.

The way I look at it, this feature doesn't prevent enums from happening, it
just changes the design parameters.

Just a thought.


On Wed, Feb 15, 2017 at 4:34 PM, Andrea Faulds <a...@ajf.me> wrote:

> Hi Marco,
>
> Marco Pivetta wrote:
>
>>
>> Since the engine is clueless about types until autoloading happens, this
>> is
>> easily solvable by providing a marker syntax for non-object hints. For
>> instance `function foo() : enym:MyEnum {}`
>>
>
> If we're going to do prefixes for non-classes, we might as well copy C
> outright: `enum MyEnum`.
>
> Thanks.
> --
> Andrea Faulds
> https://ajf.me/
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to