Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87848 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 975 invoked from network); 21 Aug 2015 22:00:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2015 22:00:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.192.45 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.45 mail-qg0-f45.google.com Received: from [209.85.192.45] ([209.85.192.45:35300] helo=mail-qg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/22-19109-48F97D55 for ; Fri, 21 Aug 2015 18:00:39 -0400 Received: by qgj62 with SMTP id 62so54997849qgj.2 for ; Fri, 21 Aug 2015 15:00:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=a4RjueslVBb+KN3/eotN9y0g5ES0UTibQ798JQHvQ1Q=; b=PFvmeWwhSew1GhhKf0ei6tVp0Q93tVmQvHBpALqtdpFcjJJqu0EqG5fU/R2UAnIpKM cAXHj3Y5uV6bYefDeSHOXIuglpNpTDA4l3wTP7e58LlsY779R0Cbnj3tuD3oz8DcR5/i lAfkXEeO7/DylcHQnom9RPwO0l0FTJEY05fhXwYm2/3ycAIn3xG97wOQQWxf6ukt8HVR J8OMALPsO1b/+poIsSQ0I5g57JaEacoLpF5tLoBFQSlh9tO2XWcIGpj0DSuxU9KYMN3n TQxXeUoWQdicJU7XC1+H+5Up682PlRcKFgjwtHtq821ZmideXe15zwtqWPNTpwuV7KJx QLhw== X-Gm-Message-State: ALoCoQlzQmmXyEdmgpYSAj6YFuJgAYhzRk1Wcv9cY9UY+PYWZGHfdy19vKpu3mU+soGSvYae8b/r X-Received: by 10.140.195.148 with SMTP id q142mr22786363qha.92.1440194433801; Fri, 21 Aug 2015 15:00:33 -0700 (PDT) Received: from [192.168.101.54] ([199.168.151.39]) by smtp.googlemail.com with ESMTPSA id i72sm4681580qkh.3.2015.08.21.15.00.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Aug 2015 15:00:31 -0700 (PDT) Message-ID: <55D79F7B.3030302@lerdorf.com> Date: Fri, 21 Aug 2015 15:00:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Anthony Ferrara , Scott Arciszewski CC: Pierre Joye , Trevor Suarez , Niklas Keller , PHP Internals References: <99CE9AAF-E6E9-4D37-B462-E4A63139EAFB@icicle.io> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6DwBtjBlsNiebGq7sHxnccfHCkEQO0svQ" Subject: Re: [PHP-DEV] Recap - Core functions throwing exceptions in PHP7 From: rasmus@lerdorf.com (Rasmus Lerdorf) --6DwBtjBlsNiebGq7sHxnccfHCkEQO0svQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/21/2015 06:36 AM, Anthony Ferrara wrote: > My proposal/stance: >=20 > Let's make random_* throw an Exception if it cannot connect to a > random source. And let's have it throw an TypeError if ZPP fails, or > Error if min >=3D max. >=20 > The first two are consistent with existing exceptions. I don't think anyone would argue those two. It makes sense. > The third (Error if min>max) is where the contention lies. I'm > suggesting Error as it's consistent with parameter errors in the sense > that the type may be correct, but the value isn't (hence it's the same > kind of error as a parameter error, just a different > sub-classification. >=20 > MHO is this is too important of a distinction to simply gloss over. > Having it return false (or null) will be a problem, as nobody will > perform the error checks. And returning $x where `$x =3D=3D 0` in a > security context could be incredibly bad. As such, I think the > security implications here outweigh nearly all of the other concerns > about consistency and convention. >=20 > That's my opinion. I'll be happy to make the changes if a RM gives me > the green light to do so. An error on this makes sense to me too and it doesn't seem like much of an issue to make this change now. But yes, it is the RM's final call. -Rasmus --6DwBtjBlsNiebGq7sHxnccfHCkEQO0svQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXXn3sACgkQlxayKTuqOuCVzwCfaFrofn3I98HV8uTeQW6hnsFU zTAAoIm7r3BPNqoyIwZ87p5k8znmdcHD =9cQ4 -----END PGP SIGNATURE----- --6DwBtjBlsNiebGq7sHxnccfHCkEQO0svQ--