Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98388 invoked from network); 17 Mar 2016 08:10:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2016 08:10:53 -0000 Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 74.125.82.43 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 74.125.82.43 mail-wm0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:38885] helo=mail-wm0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/00-32687-B866AE65 for ; Thu, 17 Mar 2016 03:10:51 -0500 Received: by mail-wm0-f43.google.com with SMTP id l68so105037476wml.1 for ; Thu, 17 Mar 2016 01:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=dAC/tdkrIlMwjmbPlgfFSxVD8gxRt1eALEIukSzJtdg=; b=BfrhreD9DoXiTBEgT4hhBkZH9hPe99/w8bhaIxOEsuQ/Gisj3nkgTD+Tuxkre6yRds JXVCQ2rMepBt27rynV7OBHkJplVEpigha5m5fDbgT3zoW8Mj8uMpnExkSJXZUlzjJLga MuCxExqGONV9hr3osrTUuWMZAw6qKlakn3bdCTSPtm20P2vg6zhbF+P0GhQE3cJtXnrk iSxbmkKsY837Xrt7ABqJ9rD5u9XOsZaO//mqg0eCDttMjDFB8No1taNQUZqgODYHfzag jH5ajwBYyXdKn8jv4Sdsad28hJVg8JqfRhLemH8DJyGAnm5I4Fm/uwAMsNdoliX8gt28 GEnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=dAC/tdkrIlMwjmbPlgfFSxVD8gxRt1eALEIukSzJtdg=; b=TWlxuy2/c0fSCnY9XztDpifmlf7F++1VEc/8gSKtIj4iZmi7y0jldk1/V2IM5N6lKv 51Cogn1FMqQW3NUhCoci/IXjpNwHvXZb3kA1Co9/qpDJh9xeSjk7aOwaO37/t4R9KFXl dsJAelvSAuqJbgLkFjaWCtzdosWj/rvD4pkqUHLXX9Q+lOV23o9gjwfYvDoIz1KRabrT i2d9ApCIk3FCuWall6Sy1zWKZA4dr6zKS34YkAu3u2ncobNoeF5sKrYgaVmpkxiFhKqU yeSrzOkF4YFlWaf3o+k99wf9PvVkHtAqt/suqgJjiZrFme+iiEr76iCU8wKQkWy8HKsW k1mQ== X-Gm-Message-State: AD7BkJLX6Cpxjr3LNA51Bqe75e1j6Cd1v9Cl9jKhDThr+S1QoSOKF9XbT9Rmm2bzjb0cOVZWfBi7UBfExtl0rw== MIME-Version: 1.0 X-Received: by 10.28.179.7 with SMTP id c7mr9566776wmf.46.1458202247974; Thu, 17 Mar 2016 01:10:47 -0700 (PDT) Received: by 10.194.94.163 with HTTP; Thu, 17 Mar 2016 01:10:47 -0700 (PDT) X-Originating-IP: [77.11.99.249] In-Reply-To: References: Date: Thu, 17 Mar 2016 09:10:47 +0100 Message-ID: To: Phil Sturgeon Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11452e4c00631b052e3a2b72 Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: kontakt@beberlei.de (Benjamin Eberlei) --001a11452e4c00631b052e3a2b72 Content-Type: text/plain; charset=UTF-8 On Wed, Mar 16, 2016 at 5:36 PM, Phil Sturgeon wrote: > Hello everyone, > > I have completed the draft for an RFC, to add Typed Properties. The > patch has been written by the one and only Joe Watkins. > > https://wiki.php.net/rfc/typed-properties > > I would really appreciate constructive feedback on this RFC, with a > few areas especially: > > 1. How scared are we that integers can be expanded to floats on runtime? > 2. This whole temporary nullability situation, where unset properties > will error on attempted usage if not set. Should they instead error > after the constructor has been called if they are still not holding a > value? > > 3. Weak vs Strict. Right now this is entirely strict, with no > declare() to change mode. Reasons for this vary, from various sources, > but include "Not sure how to implement it" and "Well people should not > be using properties as part of their public API". > > Help on 3 would be appreciated. > > Also let's please avoid "PHP IS TURNING INTO JAVA" and the other > rather common rhetoric. Strict Type Hinting might have been seen as a > battleground for fans of strict and fans of weak to fight through a > keyboard, but this RFC will not be the repeat. > > We'll have a nice, orderly, constructive conversation about this RFC, > and improve the patch as you all provide feedback. > > Let me know what you think folks! > Thanks for the RFC. I love it. Some points: 1. You should really try not to open any can of worms with regard to other already defined parts of the language: - Assume type juggling is a given, use that exact same rules - Assume strict/weak is a given, don't try to change this. - Document how public int $var; works with regard to default type, explicitly define it outside the scope of nullable types and delegate decision forward to a potential RFC in that area. Regarding your bullets then: 1. This point is outside the scope of this RFC, it might be relevant when we discuss changing type juggling to be more consistent. 2. This is propably the critical point of this RFC, I think given how public function foo(int $i) forces type juggling, typed properties should force juggling to. This must be after the constructor, because public stdClass $foo; would otherwise never work. 3. Weak vs strict: Outside of this RFC, assume that it is strict when declared, otherwise weak for consistency with the status quo. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11452e4c00631b052e3a2b72--