Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102353 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90969 invoked from network); 21 Jun 2018 16:24:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2018 16:24:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=patrickallaert@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.49 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-lf0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:46497] helo=mail-lf0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/E3-32156-151DB2B5 for ; Thu, 21 Jun 2018 12:24:50 -0400 Received: by mail-lf0-f49.google.com with SMTP id m4-v6so3728652lfj.13 for ; Thu, 21 Jun 2018 09:24:49 -0700 (PDT) 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=4vTlfkSzhnVuhoyKdMRq71mMovYc02f3u7xkLcLjAAs=; b=efR171wYtt0TqWPyO12SaCmmjLeul6reILZ0cnYekk0a4+MVCIHHD/dh5r+mE2U/b0 RjuFzAyy9STxMr174oCI2pBSBc8PnqCB5OKyw40nFkw3DxiE41M5EbyB9DDDooklvfmF d7O+QSeEeuIQMdpoGhRBr8r2UR16GiwPiuGSsA36t40E3N4E8bfEiKA0fZ+loN70FniQ egLsWTnzfjPAmGh8IDIVrVZS8fu7lYOuQWaGbEwG9bc7pq8tKdXyOful4bSM+7kf8gQJ VQgeKDcnK7u4/K0yRvH7ulWDwKEy8X17UESO44zufvvG+u+9vOry+ZEQDmgZKtcC/QEb F5Ig== X-Gm-Message-State: APt69E1h2lgiWJ4ZB82TybOQ4ALvpgMEIrrYN5IK+utTpzIBak7hMIFa BVSE8i0rE8n9x0evaovG65/K5uJhBx0AAnLMEA== X-Google-Smtp-Source: ADUXVKL4F+x4bQJixFMrVAGDBymDhIgrOZ57XFrJm7x4EwniwNKO2GOjotnEB1TSUki5btK0TiaDFVV2uytxXK8O7a4= X-Received: by 2002:a19:23cb:: with SMTP id j194-v6mr15045989lfj.90.1529598286692; Thu, 21 Jun 2018 09:24:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 21 Jun 2018 18:24:35 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000087083e056f295a21" Subject: Re: [PHP-DEV] [RFC] Typed Properties From: patrickallaert@php.net (Patrick ALLAERT) --00000000000087083e056f295a21 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le jeu. 21 juin 2018 =C3=A0 00:00, Nikita Popov a = =C3=A9crit : > Hi internals, > > Bob and I would like to present a new typed properties proposal for your > consideration: > > https://wiki.php.net/rfc/typed_prwould some benefitsoperties_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 ca= se > this feature will go into the next PHP version. > > Regards, > Nikita > Hi Nikita, Bob, Congrats for the awesome job! It looks very good. My only concern is about regular variables, not bound to any classes. Isn't that a little bit inconsistent that classes properties could be typed, but not a regular variable in the middle of a function/method/plain "script" file? I would see some benefit doing something like: string $content =3D file_get_contents("/foo/bar"); (Sorry if this has been raised already in the past) Patrick --00000000000087083e056f295a21--