Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91466 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7295 invoked from network); 1 Mar 2016 11:34:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2016 11:34:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.43 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wm0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:36189] helo=mail-wm0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/50-04147-84E75D65 for ; Tue, 01 Mar 2016 06:34:32 -0500 Received: by mail-wm0-f43.google.com with SMTP id n186so32065008wmn.1 for ; Tue, 01 Mar 2016 03:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=vpUJ7/UvFzITPc9cKDWjQSER/lHHMuXMwJY19I7H960=; b=c9RQEx7e2/GEL2KCiVgeVUBV8b/lvYaqI3s41QBmhFyKfgIJdo1ewMPTXeulhTuxXy X22TtPlaUWcxUTQVTxPYvsKNL5W5dzHYTAHjYOM0saGk8lnOuU1kzHqVdE8f2nfkRvoJ KaVfkvZ9DquPKiC5hHZwFSEV22Yf5+pjlZ1eKPhlWWCDtn8BQ6TxCVboJbb1Jx7xb0/6 60RI6u+Xpyr9keP54PFal9DlzR8X/NlBkAX+mE9O6r6r2WgxVj4jOSH3FGS+bVQiH8wL uyMY4RA1XD9kajic+u+wuy1FDDghZU6lhw8XbBh4tMSnvq1Ns6yOnjfwtsKblmiPAW03 oROA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=vpUJ7/UvFzITPc9cKDWjQSER/lHHMuXMwJY19I7H960=; b=O/CdDa5w8dJQZk/NzVD18JCRzUZvf11grgksg56FIzL2SMPfFeY2bcVub5HHgK+jAE S2XzSAoctp/Z3ScWFjLEOZN+Fl2eQh5Bml1kq7A8ta9wVvlRVInX4wuhDIojHa4oS2Fn 5Iy9sLQIGGglQpSFFCk1l2XM65yhweksIfqp0C7pOaCxJdwfbNm0St+1vSzWue3uMZ3t qrBcwx6MaIY7l3HTBLUloSkpau4/WmVvPHCiXzPoagRKWi1br6tL3ptT2YN2ONZgYVSC 2KQQMw6vt7UJ9Wlm5deg8d+Y6jdFWzSZpq65g91wgKlxzqRIxpVf4A+fSNIenCPOWNaM +9OA== X-Gm-Message-State: AD7BkJLHdXEDW8ej1erEFMN5vSBTDagYH+8iVoz+LRXfqESMz99SY8cO8VxpEMDUPaeHIA== X-Received: by 10.28.21.14 with SMTP id 14mr3052580wmv.39.1456832069649; Tue, 01 Mar 2016 03:34:29 -0800 (PST) Received: from [192.168.0.141] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id g3sm30592408wjw.31.2016.03.01.03.34.28 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2016 03:34:28 -0800 (PST) To: internals@lists.php.net References: <1F.91.55238.41F10D65@pb1.pair.com> <56D42CD3.6020602@gmail.com> Message-ID: <56D57DF4.8000906@gmail.com> Date: Tue, 1 Mar 2016 11:33:08 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal From: rowan.collins@gmail.com (Rowan Collins) Tony Marston wrote on 01/03/2016 09:32: > "Rowan Collins" wrote in message news:56D42CD3.6020602@gmail.com... >> >> Tony Marston wrote on 29/02/2016 09:55: >>> "James Titcumb" wrote in message >>> news:CAKnqCEY7art1GUWG=Pm0wyPGQmYp0Dq8oxdohgBkSGq+O_BTZw@mail.gmail.com... >>> >>> >>> Incorrect. It *may* be modified, but surely any invalid modifications >>> will be detected in the testing phase? >> >> Detected by whom? Using what tool? > > If changing a variable directly instead of using a setter does not > produce an error that can be detected in your testing, whether that > testing is automated or manual, then is there actually an error? If > doing something does not cause a problem there there is no problem > that needs fixing. Preventing something from happening which does not > cause an error even if it did happen seems like wasted effort to me. > Firstly, no test suite can ever truly cover 100% of scenarios that the live application will encounter, so the idea that a bug doesn't exist until it causes an error is asking for trouble. You want to catch mistakes as early as possible, and that is exactly what member visibility is there for in the first place - to stop you in your tracks if you try to access something that was supposed to be internal. Secondly, violating visibility may have repercussions outside actual errors. Consider something relying on accessing an "internal" property and writing dozens of lines of code assuming it is of a particular type. Then consider that the maintainer of the module which declared it refactors and removes, renames, or changes the type of that property, confident that they are safe to do so because it was for internal use only. The result is much more wasted effort than keeping an eye out that you're not violating visibility in the first place. Regards, -- Rowan Collins [IMSoP]