Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83019 invoked from network); 19 Nov 2014 03:07:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2014 03:07:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:59486] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/50-15277-8790C645 for ; Tue, 18 Nov 2014 22:07:38 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 110572400D3; Tue, 18 Nov 2014 22:07:34 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Kx9gxeXwah42; Tue, 18 Nov 2014 22:07:33 -0500 (EST) Received: from oa-res-27-29.wireless.abdn.ac.uk (oa-res-27-29.wireless.abdn.ac.uk [137.50.27.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 786112400DC; Tue, 18 Nov 2014 22:07:32 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Wed, 19 Nov 2014 03:07:30 +0000 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <656B2A54-572B-4E6A-892B-25FAE428F434@ajf.me> References: <66B7B28C-2651-4A71-AC2A-55D4C7BB3DDC@ajf.me> To: Yasuo Ohgaki X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Safe Casting Functions From: ajf@ajf.me (Andrea Faulds) > On 19 Nov 2014, at 03:02, Yasuo Ohgaki wrote: >=20 > I would like to have DbC to harden app security as well. > I'm looking for something like D language. >=20 > http://dlang.org/contracts.html >=20 > With DbC, checking parameter types/range/etc happen only when = development. > Therefore, app runs faster for production. All of runtime checks = cannot be removed > from app code by DbC, so this RFC is nice to have even with DbC. Something like contracts is actually an idea I=E2=80=99ve had before. = Even some of the most expressive type systems (like Haskell=E2=80=99s) = seem to neglect that only a certain range of values of a primitive type = may be desired. Having something like that in PHP might be useful. But I wouldn=E2=80=99t say it=E2=80=99s really on-topic. -- Andrea Faulds http://ajf.me/