Hi,
as this probably requires some discussion, I'm coming here to ask.
I'm talking about bug 69977 and 61483: Both are about the fact that it's
currently not possible to properly type-hint descendant classes of DateTime
and friends.
The reason is the missing use ZEND_ARG_OBJ_INFO, so right now, users can
only create descendant classes without any type hinting on their methods.
Adding the ZEND_ARG_OBJ_INFO is quite trivial and in-fact, I have a branch
here that does it:
https://github.com/pilif/php-src/tree/bug-69977
Of course this is going to break a whole lot of tests because what was once
warnings is now a TypeError.
I'd be willing to update all the tests as needed, but of course changing
the behaviour like this is a BC issue in itself, hence I'm coming here.
The reason why I think this matters much more now than back when 61483 was
submitted is two-fold:
1) back in 61483, adding the (correct!) type-hints was "just" causing an
E_STRICT message. But now with PHP7 it's actually an E_WARNING. So people
running without E_STRICT enjoyed correct type hints until now which they
now can't any more (so, there's another BC break right there :p)
2) With PHP7 type hinting becomes much more viable, so forcing users to not
type-hint something that really should be feels kind of ugly.
3) Having a new major release is as good a time as any for chaning the
behaviour, especially when the change is related to a major new feature
(the addition of much stricter typing).
So I'm asking for opinions on what should be done here.
Again: If you lean /at all/ in the direction of changing this, I volunteer
to update all the tests as required.
Philip
--
Sensational AG
Giesshübelstrasse 62c, Postfach 1966, 8021 Zürich
Tel. +41 43 544 09 60, Mobile +41 79 341 01 99
info@sensational.ch, http://www.sensational.ch
as this probably requires some discussion, I'm coming here to ask.
I'm talking about bug 69977 and 61483: Both are about the fact that it's
currently not possible to properly type-hint descendant classes of DateTime
and friends.
The reason is the missing use ZEND_ARG_OBJ_INFO, so right now, users can
only create descendant classes without any type hinting on their methods.
Adding the ZEND_ARG_OBJ_INFO is quite trivial and in-fact, I have a branch
here that does it:
https://github.com/pilif/php-src/tree/bug-69977
Of course this is going to break a whole lot of tests because what was once
warnings is now a TypeError.
I'd be willing to update all the tests as needed, but of course changing
the behaviour like this is a BC issue in itself, hence I'm coming here.
The reason why I think this matters much more now than back when 61483 was
submitted is two-fold:
1) back in 61483, adding the (correct!) type-hints was "just" causing an
E_STRICT message. But now with PHP7 it's actually an E_WARNING. So people
running without E_STRICT enjoyed correct type hints until now which they
now can't any more (so, there's another BC break right there :p)
2) With PHP7 type hinting becomes much more viable, so forcing users to not
type-hint something that really should be feels kind of ugly.
3) Having a new major release is as good a time as any for chaning the
behaviour, especially when the change is related to a major new feature
(the addition of much stricter typing).
So I'm asking for opinions on what should be done here.
Again: If you lean /at all/ in the direction of changing this, I volunteer
to update all the tests as required.
Philip
--
Sensational AG
Giesshübelstrasse 62c, Postfach 1966, 8021 Zürich
Tel. +41 43 544 09 60, Mobile +41 79 341 01 99
info@sensational.ch, http://www.sensational.ch