Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87003 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64684 invoked from network); 2 Jul 2015 14:51:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2015 14:51:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:50299] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/E0-52843-8EF45955 for ; Thu, 02 Jul 2015 10:51:21 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id 3913823D6299; Thu, 2 Jul 2015 16:51:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on h1123647.serverkompetenz.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.5 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from w530phpdev (pD9FD2CAA.dip0.t-ipconnect.de [217.253.44.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id B65D223D615B; Thu, 2 Jul 2015 16:51:15 +0200 (CEST) To: "'Philip Hofstetter'" , "'PHP internals'" References: In-Reply-To: Date: Thu, 2 Jul 2015 16:51:17 +0200 Message-ID: <07c501d0b4d6$8f446690$adcd33b0$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHpxBZHfAqKSNVigXb8gPhcoTVKj52WIxBQ Content-Language: en-us Subject: RE: [PHP-DEV] date extension / Type Hinting From: anatol.php@belski.net ("Anatol Belski") Hi Philip, > -----Original Message----- > From: Philip Hofstetter [mailto:phofstetter@sensational.ch] > Sent: Thursday, July 2, 2015 3:35 PM > To: PHP internals > Subject: [PHP-DEV] date extension / Type Hinting >=20 > Hi, >=20 > as this probably requires some discussion, I'm coming here to ask. >=20 > 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. >=20 > 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. >=20 > Adding the ZEND_ARG_OBJ_INFO is quite trivial and in-fact, I have a = branch here > that does it: >=20 > https://github.com/pilif/php-src/tree/bug-69977 >=20 > Of course this is going to break a whole lot of tests because what was = once > warnings is now a TypeError. >=20 > 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. >=20 > The reason why I think this matters much more now than back when 61483 = was > submitted is two-fold: >=20 > 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). >=20 > So I'm asking for opinions on what should be done here. >=20 > Again: If you lean /at all/ in the direction of changing this, I = volunteer to update > all the tests as required. please read this thread for more info = https://github.com/php/php-src/commit/8e19705a93d785cd1ff8ba3a69699b00169= fea47 .=20 Regards Anatol