Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102334 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14256 invoked from network); 20 Jun 2018 23:10:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2018 23:10:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:36552] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/79-32156-FEEDA2B5 for ; Wed, 20 Jun 2018 19:10:39 -0400 Received: by mail-wm0-f41.google.com with SMTP id v131-v6so2389420wma.1 for ; Wed, 20 Jun 2018 16:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lMFQGiVwOGJeNWgZ0nwD9wmm5IRekBBC3dc4vIZr50o=; b=bwRszndQMGwFP6Ss5RcQufE+s66DI3USV5dFa9D3nb6HJq2CgeNd8eMij9ahc9fwmx RZZ632W2c06Q8yW9IB342p4og7KFB9nKtnt4KoRuQnVqa9+ias/dXFpOuU4Ij3w+2n3f 0nIrvxUt4GYCubNFbD53DhlZo48R9pb3+7163WLY4QMUFBlUpnBSmHoEKPlhT2sgU7FZ IVvI7RSLymEYE5xFgT0HstG89g+75UhzwTI6T1F81+Z+vVZt7314W24WZO+TSwjYGr5p 417qZavo5+G0VLuZAlBG9gu7rzKGa3giUmc8eV5YOLyE0wQZYWTD0x9/QDlNqRxGH/Ig cWig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lMFQGiVwOGJeNWgZ0nwD9wmm5IRekBBC3dc4vIZr50o=; b=b1Hu3m1N2OtHQceELAxcuibubJ8jbJUgsObJ5tHsLFNmioLQFB9fgtpPGMXB+ptglO 3XPbs17jejci5QR7K9tjSKU8t9JydZ6xQ3tdK16sfFAw7/0D5Zmg4XRjUD5/6isWq3E5 y5zpbfccVD3zBhlV5t8/3qVGJi3f1sAyqjuEkjKrr1AiFMcmHlFbAcd+0OBeRBT2cqQz KfQVaoCiycd9tvpbND2I6zrfRVS+zBWkdsh0wPeKB2al0hJ9GDpwXrbFKifu2oyKyTOo jvvX+OT4m/7wl5CgzGVAiHZu7UvZdwp8yKPRj1pbtj9kTU4r5+rAG6N9SijXI+5HTJKt Vyow== X-Gm-Message-State: APt69E1AMCBvLbqlxjdrQ98eAJDTMduC724VpTDQV35F6Vh02oc2Y16Q 2zO61xFz/ZqRVcCqW5wsHdb2Crs4LanQbWY6bFw= X-Google-Smtp-Source: ADUXVKK/LpkkBX6IwcvBVGJTLsxX7r2p6qPsah7/q3Ib7WOyw+mJ3OPwP9fLuatyDJ2Uu6KPNRjMYERpBMJcSo2wQ8s= X-Received: by 2002:a1c:228b:: with SMTP id i133-v6mr3293165wmi.92.1529536236012; Wed, 20 Jun 2018 16:10:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 21 Jun 2018 01:10:23 +0200 Message-ID: To: Nikita Popov Cc: PHP Internals List Content-Type: multipart/alternative; boundary="00000000000004ca29056f1ae855" Subject: Re: [PHP-DEV] [RFC] Typed Properties From: ocramius@gmail.com (Marco Pivetta) --00000000000004ca29056f1ae855 Content-Type: text/plain; charset="UTF-8" Hi Nikita, Bob, On Wed, 20 Jun 2018, 23:59 Nikita Popov, wrote: > Hi internals, > > Bob and I would like to present a new typed properties proposal for your > consideration: > > https://wiki.php.net/rfc/typed_properties_v2 > > The proposal allows you to annotate properties with types, which are > enforced at runtime. Unlike the previous RFC on this topic, the new > proposal also supports typed static properties and references to typed > properties. > > Please note that next to the main body, the RFC also contains an > "Alternatives" section, which explores the problem space and considers > trade-offs of different behaviors in some detail. > > Finally, while this RFC currently targets PHP 7.3, this is a large and > complex proposal and we may not be able to meet the deadline, in which case > this feature will go into the next PHP version. > > Regards, > Nikita > This is awesome news! I skimmed over the proposal and it is extremely well thought out, and almost everything that was causing a -1 on the previous RFC is gone: kudos! The last bit that is missing is the `__get` kink, mostly because `__get()` is "squishy by design". Still, the fact that references are properly typed mitigates the issue for my shady use-cases (I've got a reputation there), so I'm quite happy with an implicit magic type check. One thing I couldn't find is whether this magic check is also enforced when calling `__get()` explicitly, and not via the guards in the engine. Is the current development branch usable for testing something locally? I can't see any obvious mistakes here, but I just wanted to try this out with some of the more obscure libraries that touch property state at the level that is covered by this RFC. > --00000000000004ca29056f1ae855--