Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79686 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31594 invoked from network); 16 Dec 2014 04:19:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2014 04:19:49 -0000 X-Host-Fingerprint: 24.12.158.105 unknown Received: from [24.12.158.105] ([24.12.158.105:2653] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/32-13907-4E2BF845 for ; Mon, 15 Dec 2014 23:19:48 -0500 To: internals@lists.php.net,Robert Williams Message-ID: <548FB2E4.2030608@gmail.com> Date: Mon, 15 Dec 2014 22:19:48 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 CC: "internals@lists.php.net" References: <548D494B.8010901@gmail.com> <548DC988.6030108@gmail.com> <548E84D1.9030401@gmail.com> <94025CC8-8A1A-4A28-BD7B-9E122CAD31FB@thesba.com> In-Reply-To: <94025CC8-8A1A-4A28-BD7B-9E122CAD31FB@thesba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 24.12.158.105 Subject: Re: [PHP-DEV] Fix incorrect ternary '?' associativity for 7.0? From: leeoniya@gmail.com (Leon Sorokin) On 12/15/2014 11:59 AM, Robert Williams wrote: > What world is this that you live in where every line of code that’s written is fully unit-tested You took my example too literally; forget the unit tests. Imagine the situation differently: 1. Someone wrote this function: function add_five_pct($num) { return $num * 1.10; } 2. This function was then used to calculate profit margin and display retail prices on your site and business has been great! Unknowingly, you've been making 2x what was intended with no ill effects! 3. A new hire then went through this code on his own accord and decided, 'wait, this function is a bug!' and took it upon himself to fix it to '$num * 1.05'. Would you say the e-commerce site has been 'fixed' to work correctly? Should the dev be praised for fixing the clearly broken function without consulting anyone? I cannot come up with a clearer explanation of how a 'silent' code fix can foul up the bigger picture in non-beneficial ways. That's the scenario that's being discussed here. The main point of contention is, no one knows how much code exists in the wild that uses and relies on this misbehavior. My argument is 'negligible', others say it's 'non-negligible'. And the whole comedy is, no one can actually provide definitive numbers since nobody will ever know but a tiny portion of all source code that is out there, so all arguments stem from 'meta' evidence and personal experience. -- Leon Sorokin