Re: [RFC] [Vote] Callable types (now: Callable prototypes)

From: Date: Tue, 24 May 2016 06:01:27 +0000
Subject: Re: [RFC] [Vote] Callable types (now: Callable prototypes)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-93467@lists.php.net to get a copy of this message
On Mon, 23 May 2016 22:59:10 +0300, Markus Fischer <markus@fischer.name> wrote:
Hello Nikita, On 23.05.16 21:27, Nikita Nefedov wrote:
When you pass an int to a string type parameter in weak mode it's being coerced to the needed type (not just directly passed). This is quite complex, because you'd need to copy zend_function and all its members (without changing the original zend_function). I would love to support it but all in all it comes down to implementation here for me, so I'd rather do it in a separate RFC.
I like the RFC, however I do not like this behavior. This would behave differently then how current weak/strict mode works. I was never a fan of the weak mode to begin with, but now introducing something which deals in the area of argument passing and not behaving to what a 2/3 majority agreed is IMHO a no-go. The current RFC does not even mention that. Maybe it's not feasible anyway, but in any case I'm missing input/discussion in this area. - Markus
Morning Markus, Well, those strict/weak modes were initially invented for basic types, not for composite types so I'd question if their support is needed at all... For example regardlessly of what mode your file in, if you implement an interface with function foo(int $b) you'd always have to implement it with int, and not float.

« previous php.internals (#93467) next »