Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91732 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2371 invoked from network); 17 Mar 2016 09:11:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2016 09:11:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=crocodile2u@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=crocodile2u@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.52 as permitted sender) X-PHP-List-Original-Sender: crocodile2u@gmail.com X-Host-Fingerprint: 209.85.215.52 mail-lf0-f52.google.com Received: from [209.85.215.52] ([209.85.215.52:34028] helo=mail-lf0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/80-32687-CC47AE65 for ; Thu, 17 Mar 2016 04:11:41 -0500 Received: by mail-lf0-f52.google.com with SMTP id e138so36403622lfe.1 for ; Thu, 17 Mar 2016 02:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ejAUUoEknGtJ5ZKdRpts4tnXBoHUj6RlsQADd+VQSg=; b=PfJrSCFrm9CWiQHKfUhtu1wQvJOLGsMmzIaumLe5dvaBLKnEluCC8wg88a4ccut4ze ip/qh8aZ6U9O+ztXHeyQyuYul+AvXM/UfRuG3Yjygch5vr9K0phMkpylOtTex/7PwWZv PHK67fUzPuETlLG312W/x8bX8zgHIzuQr+9JfUvQL+uo/36agGVzb/iC4zkyDLg7kse4 NYUD7b2KQd4bTuJsBo1/b++ezHvn+00My2CqIeUJDJyBUiR4MqECw2vfHWrNsu54Lzw8 TcRoSvbdYb9r67uG0L5t4a/mrUBfqgw57aZmRE9FeRcOOnDdJcLPLVrBKsR2wn3WGibH kc+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8ejAUUoEknGtJ5ZKdRpts4tnXBoHUj6RlsQADd+VQSg=; b=FtibShi3E87on0aH96Qs53fRnhCko1BIwWKsR+znGRoj9tWmEwBarXwQD0/W/XTC2Z y/KIBL9Z/Fp3mfXJMIU8LDanVlqpZWTkCst0wqZDA/yWY8QoIejIhy5SvF5kWKXTOw/k hmFKLA5xZSlMu7P8AxHEjxjspypwuj94T0oRgReUYkXGFnFcQnOzUoLxyObWNI4XtBGF vMfl9Yz/EaoP0gbHUOdr8OPCOkRczcmIEXhp78zTo973TsluXr6gghVg3SbfaEY8KnE5 8uySYx7RaWlXWJokuFr+Zo7e0wLjcImPb3V9KFrmIHFeXti4llQ4SlZXwCXV3v042c+i ANxA== X-Gm-Message-State: AD7BkJI/thpNF2luI1J8Gc4gQl+UpxzrvGhvEMqvtRwe4yfpPWuwdMNZO8tyN9+5jme6VDgy+/+dNnZoSgsiPg== X-Received: by 10.25.7.206 with SMTP id 197mr2525583lfh.107.1458205898109; Thu, 17 Mar 2016 02:11:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 17 Mar 2016 09:11:28 +0000 Message-ID: To: Benjamin Eberlei , Phil Sturgeon Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113eaf3290fb6c052e3b047a Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: crocodile2u@gmail.com (Crocodile) --001a113eaf3290fb6c052e3b047a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable What about PDO's fetch-mode PDO::FETCH_CLASS? Apparently, it first fills in properties and then calls the constructor. Seems unlikely that the new behavior for uninitialized properties will cause a problem here, but sometimes weird things happen. And this is another thing to check. I also fully support Johannes Schl=C3=BCter with the reference thing. Bindi= ng by reference to a query, passing by reference to any sort of function might happen here and there, and the developer will have to find workarounds in a place which otherwise would be straighforward. Having said that, I +1 the idea of typed properties (well, my internals karma does not give much weight to this anyway ;-) ). On Thu, Mar 17, 2016 at 9:11 AM Benjamin Eberlei wrote: > 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 othe= r > 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 > > > > > --=20 Best regards, Victor Bolshov --001a113eaf3290fb6c052e3b047a--