Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87300 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9368 invoked from network); 26 Jul 2015 18:36:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2015 18:36:42 -0000 Authentication-Results: pb1.pair.com header.from=kelerest123@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kelerest123@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: kelerest123@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:35568] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/70-06606-9B825B55 for ; Sun, 26 Jul 2015 14:36:42 -0400 Received: by obbop1 with SMTP id op1so45581804obb.2 for ; Sun, 26 Jul 2015 11:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=KuNYVxXV9aUBb9MgPutLSPEjMUHK93BUAzQi7mMOSXk=; b=T70cIZxgeqHn6rwr9mLyUDUt67K9T6f+6eo3dqg8xQn3FT+WhLCBigdBWDDKiDJwA+ +Ue9iRwBlLyXZPQwfqLbF1IGP5Tdt9v1NR8K5/xBAW+DFgqlrxl6+0DceqXCc+JP1e8t v4EMIEOsc1VnU1zeNPM1h9wYXoz+ke3h0pc4lORybYUHm7QK/HEHCidtb7dG7oPZzGT1 vO4yU+szWo/0t3whgug+jLfmoHesFws6WIslGqWjD8DRpq6AX2Kz3LtC/+/uDIIHpUCM bxuIHp+KqoCCmkA+gwVX4AdxkzkUJKpjm906Uf3SCQuPfIpt9SgJ7Jj7sYBnLwNmc+jv CxwQ== X-Received: by 10.60.82.67 with SMTP id g3mr23777099oey.29.1437935799412; Sun, 26 Jul 2015 11:36:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.109.33 with HTTP; Sun, 26 Jul 2015 11:36:19 -0700 (PDT) In-Reply-To: <55B41BEC.20104@garfieldtech.com> References: <55A7D993.5000301@moonspot.net> <55B2D142.6020802@gmail.com> <55B41BEC.20104@garfieldtech.com> Date: Sun, 26 Jul 2015 20:36:19 +0200 Message-ID: To: Larry Garfield Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Core functions throwing exceptions in PHP7 From: kelerest123@gmail.com (=?UTF-8?B?SmFrdWIgS3Viw63EjWVr?=) Hi Larry! 2015-07-26 1:29 GMT+02:00 Larry Garfield : > Another point here is that 0 is a perfectly legitimate random number in m= any > cases, so callers would need to do a =3D=3D=3D check, not just a boolean = check. What "boolean check" are you talkin' about? I've never seen a code using e.g. strpos() like follows: Rather it is most frequently being done like below: I think in both cases you do a kind of "boolean check". > Especially as we're talking not about a user error but a "your system is = not setup > right so it will never work" situation, as I understand it. So, I generally agree with this approach. It is a better thing to always fail closed if your system isn't set up, e.g. missing some required things, to work properly. It's the same if your code uses some vendor extension not included in the core by default -- it can not work work properly without having this extension available. I say +1 for raising a E_ERROR on random_int()/random_bytes() fail. Best regards, Kubo2, Jakub Kub=C3=AD=C4=8Dek