Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91714 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44731 invoked from network); 16 Mar 2016 21:12:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2016 21:12:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.156 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.156 v-smtpout3.han.skanova.net Received: from [81.236.60.156] ([81.236.60.156:49848] helo=v-smtpout3.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/FE-48430-C3CC9E65 for ; Wed, 16 Mar 2016 16:12:29 -0500 Received: from [192.168.7.7] ([195.198.188.252]) by cmsmtp with SMTP id gIjwasdGdcCUkgIjxamK0e; Wed, 16 Mar 2016 22:12:25 +0100 To: Phil Sturgeon References: Cc: PHP internals Message-ID: <56E9CC3E.10205@telia.com> Date: Wed, 16 Mar 2016 22:12:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfPBzdDWDA6Teh7cyncIZQE4+Z0emOWHFwqIkP6M+XvVdZlydVIYU4YU2X4JB5izgLCwB9qZ2LjMouZpPvHmA+ij7UzhPMqExRm3GOHCriVPuXvCXAY+b jWqvn4BavlvZFQ7MWX1gXZPf8LJUycPVpjuH3taeWyg/wria6ulqQ/6vRqoOcsQAW4ZpzAK/+cXZdPPqc6I+CdpJeYBxYC4FwMqrctnNbgc3dcqQmqnlfNjC Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2016-03-16 kl. 17:36, skrev Phil Sturgeon: > 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! > Like the RFC :) Could this be an opportunity to have default visibility for property's when they are typed in a similar fashion like for functions? Meaning no visibility implies public and code below would work. class A { int $i=7; function f() { echo $this->i; } } $a = new A(); $a->f(); echo $a->i; Was inspired by discussion in "var" Deprecation thread. Regards //Björn