Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71979 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46547 invoked from network); 2 Feb 2014 09:25:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2014 09:25:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.47 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.216.47 mail-qa0-f47.google.com Received: from [209.85.216.47] ([209.85.216.47:34336] helo=mail-qa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/74-30967-C0F0EE25 for ; Sun, 02 Feb 2014 04:25:32 -0500 Received: by mail-qa0-f47.google.com with SMTP id j5so8410795qaq.6 for ; Sun, 02 Feb 2014 01:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+q/7h/7rwVIsysydIPLEgN5NCzAQFywLh1IhB8zZKCg=; b=AWR0S4j3U685+qY6UtcgJIa8xdxo1MQ6H/ZeDqTIqHMa9hpmGBgXIRl2jPcJs0tHad dAKFzJas4sSUkfZ63s+D/WR4RflvhtyKxe1gA5hZVul3AOZDqyzlfZby+76UM8kQbejk ZwvJlz6hfE/k7s9U6+A9QTIeC9FUH2NMzyShEhADbrMWDNrstE+wQ6K/cpJ33Nc6cHC/ p83E+/L/vO8yTNGlNbDP2bVCcDDOtPz/7YsCB9RIzDctQtnnYUKbq9DpOqzTgBHhNk5w PwmHyVLwOHsWjEBvfZWJ6OYRxMK6DVLDdpze+U9QKv+sgxZir7P0W+jO/bnrYtetLbRa E4eQ== MIME-Version: 1.0 X-Received: by 10.224.52.3 with SMTP id f3mr46927215qag.26.1391333129469; Sun, 02 Feb 2014 01:25:29 -0800 (PST) Received: by 10.96.86.134 with HTTP; Sun, 2 Feb 2014 01:25:29 -0800 (PST) In-Reply-To: References: <98.E0.35265.E17FBE25@pb1.pair.com> <52ED66CC.8070304@ajf.me> <52ED9D74.8080807@ajf.me> Date: Sun, 2 Feb 2014 10:25:29 +0100 Message-ID: To: Sara Golemon Cc: Benjamin Eberlei , Andrea Faulds , Gordon Oheim , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE] Automatic Property Initialization From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Sun, Feb 2, 2014 at 3:46 AM, Sara Golemon wrote: > On Sat, Feb 1, 2014 at 6:06 PM, Benjamin Eberlei wrote: >> Imho HHVMs syntax has the massive flaw that you cannot use docblocks on >> those properties anymore, which is not the case with this RFC. All other >> things equal, this is why this RFC should clearly be favored. >> >> Also with typehints or - unlikely but possible - property-accesors the hhvm >> syntax will become very verbose for the __construct line, wheras this RFC >> can handle those cases without having to think about future compatibility. >> > Inclined to agree on the matter of getters/setters (though I regard > the docblock issue as trivially solvable, and the typehint/verbosity > issue as a non-issue). > > I've opened a discussion in the hhvm.dev group to look into this from > that side, and removed my "No" vote for the time being. (I'm not sold > on a "Yes" vote, however, as I'm not sure this buys us enough in its > proposed form). > > -Sara > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > And how do you think the docblock issue could be trivially solvable? Not from implementation POV, but from syntactic POV? Because I really don't want to write something like this: /** * @prop string $email @ORM\Column(type="string", unique=true) @Assert\NotEmpty @Assert\Email * @prop string $username @ORM\Column(type="string", unique=true) @Assert\NotEmpty */ public function __construct(private $email, private $username) { } Sure, it saves tons of lines of code from the classic docblock over class field approach, but it is not as easily readable. One docblock per line seems infinitely better to me. Also I'm not sure if it's OK to "reveal" internal class implementation via docblock and constructor parameters.