Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80096 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73051 invoked from network); 2 Jan 2015 14:07:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2015 14:07:12 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:53442] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/02-61219-D06A6A45 for ; Fri, 02 Jan 2015 09:07:11 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so27753335wiw.9 for ; Fri, 02 Jan 2015 06:07:07 -0800 (PST) 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; bh=eDc13HilP4uwqU5OgyfImUuK7XGbAMrJ+l455HcqrJE=; b=DxeeqmZFnXUNsVV3XgGJaFeAgbgjSfYSzinB7Z1HCfnTXzwN5Ll3rh1ZFVI2KjYLCw aV1kvfG0lQAKhjGDwS7mPZmZ2DfU3kj9ZXT7AFnqnkxGT0svaj6WSlvfrO90ApScvwYc 1WzyEvZ8azHdzmOccST/wWwdw+eMY6dkEttclJTmHjBJJrN8yBnoW6ja4tHW4fDQ0Hkc OMs74Xm2H4tXD51h9qQ1d/SKsetSysHpPCWNSDPnaVtendhqMf30a5+aq/pGcB9dUpK5 etL5fws/zZvOMorSteHJwHHILkrTvQfzPIZKGPU3zM1AGOGWKBfDF+pg7sPLh4AKjSqe mF8g== X-Received: by 10.194.81.136 with SMTP id a8mr74367235wjy.104.1420207626967; Fri, 02 Jan 2015 06:07:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.82.163 with HTTP; Fri, 2 Jan 2015 06:06:46 -0800 (PST) In-Reply-To: <54A6A4D3.9070808@seld.be> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A5DF14.7000105@gmail.com> <54A678EA.4070706@fischer.name> <54A6A4D3.9070808@seld.be> Date: Fri, 2 Jan 2015 15:06:46 +0100 Message-ID: To: Jordi Boggiano Cc: PHP Internals List Content-Type: multipart/alternative; boundary=047d7beb9c8c1ce255050babdb5d Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: ocramius@gmail.com (Marco Pivetta) --047d7beb9c8c1ce255050babdb5d Content-Type: text/plain; charset=UTF-8 On 2 January 2015 at 15:01, Jordi Boggiano wrote: > Looking at it from an OSS maintainer perspective, introducing strict hints > in code would be a huge BC break as I don't know how people use my code, > nor if they validate/coerce their user input early or not. If I suddenly > declare something as int and someone used to pass '5', they get an error. > That would make adoption quite hard in OSS IMO if you don't want to bother > people. > Regardless if this RFC gets through or not, changing the signature of a method IS a BC break in any case, so you shouldn't just move your `int` declaration from the docblocks into the method signature. That'd be a simple lib to write, it barely adds more code to your > functions, and you get strict typing. But I hardly see anyone do this, and > I would argue it's because it sounds appealing in theory but it's not worth > it in practice. > I'm actually already using https://github.com/beberlei/assert for that, and I'd like to get rid of it for simpler types. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --047d7beb9c8c1ce255050babdb5d--