On 09/12/2020 18:47, Mike Schinkel wrote:
1. Will enum methods be idempotent?

If not, shouldn't they be?


Can you clarify what you mean here? The only meaningful question I can think of is "can they change the object's state?" That's mostly answered in the RFC, most notably by specifying that enums may not have instance properties, to avoid them having any state to change.

Unless I'm missing something, trying to define "idempotence" or "pure functions" any more strictly than that would surely be a massive project in itself - for a start, you'd need a whitelist of all built-in operations which were side-effect free (i.e. no file writes, configuration changes, output, etc, etc).

Regards,

--
Rowan Tommins (né Collins)
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to