Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77600 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1107 invoked from network); 24 Sep 2014 21:49:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2014 21:49:46 -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.174 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.174 mail-we0-f174.google.com Received: from [74.125.82.174] ([74.125.82.174:39959] helo=mail-we0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/00-00701-87C33245 for ; Wed, 24 Sep 2014 17:49:45 -0400 Received: by mail-we0-f174.google.com with SMTP id w62so6439621wes.5 for ; Wed, 24 Sep 2014 14:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=Nm1DMMM1fIKlIFnJ5HeUeND4zltPYN1GAfZGg0rJiuY=; b=t4ymEfwjihNxh1XJv50Z/gRGpKk93jHrx3OI5u5fH3FjLrPOHBvICDAda7CDC1bcr1 t9n3I8dDgfY6r1XXuAGLCklnaZTH1QkET+eUs3qkSuWaoyvVVsA9lCqXTaXwQtby5+hp K6rFwqVirzZnGgdPwxkpTuj+EqgCpWu6tOaEONiZY+/Qs3kZaJbIaR9x+MZHfetfU6hm oCWR2qg5AsAQHWF2CpxIYx02iaNtIm/FPItrt40vXP8YyKF7f6+Wkn4XnCBQUu8mShvM VGkfNKqq2dUPK4l4QiPs0pn7r0642vgX2z96C3MfcrIPEet+QX7wSVPIMLBhUcol1+Hc XZJw== X-Received: by 10.180.77.100 with SMTP id r4mr14120571wiw.1.1411595381647; Wed, 24 Sep 2014 14:49:41 -0700 (PDT) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id pc6sm496949wjb.43.2014.09.24.14.49.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 14:49:41 -0700 (PDT) Message-ID: <54233C70.3060604@gmail.com> Date: Wed, 24 Sep 2014 22:49:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "internals@lists.php.net" References: <07153B91-E12F-4B16-ADD7-86CFC75C4642@ajf.me> <54220EB4.60001@sugarcrm.com> <6A21F4EF-476E-476C-A64B-246B8929172B@ajf.me> <5422DD87.80109@gmail.com> <568C0F03-B23B-43FC-963D-6D0D23405E9D@ajf.me> <54230209.2050406@sugarcrm.com> In-Reply-To: <54230209.2050406@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] ZPP Failure On Overflow From: rowan.collins@gmail.com (Rowan Collins) On 24/09/2014 18:40, Stas Malyshev wrote: >>> That said, most cases of "garbage in, garbage out" would presumably >>> remain so, since most ZPP failures result in a return of NULL or >>> FALSE, which would probably end up cast back to the expected type >>> (int(0), string(''), etc) by the surrounding code. >> Right. It’s not an E_RECOVERABLE_ERROR, you’d just get an E_WARNING. > No, you'd get E_WARNING *and* function would not run. Where before it > did run. That is the problem, not the warning - you add more cases where > the function does not run when it did before, and that can have profound > consequences on the code that depends on it. So, the problem comes with built-in functions, which have some side effect, which can be usefully run with a bogus value for an integer argument. In contrast, any function which has some side effect which is actively harmful given a bogus value would be a beneficiary of the change. A function with no side effects will simply go from "garbage in, garbage out" to "garbage in, NULL out". I wonder how many functions actually fall into each category. -- Rowan Collins [IMSoP]