Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 776 invoked from network); 4 Feb 2015 11:02:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2015 11:02:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=florian@margaine.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=florian@margaine.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain margaine.com from 209.85.213.172 cause and error) X-PHP-List-Original-Sender: florian@margaine.com X-Host-Fingerprint: 209.85.213.172 mail-ig0-f172.google.com Received: from [209.85.213.172] ([209.85.213.172:44679] helo=mail-ig0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/69-55046-E4CF1D45 for ; Wed, 04 Feb 2015 06:02:38 -0500 Received: by mail-ig0-f172.google.com with SMTP id l13so33698909iga.5 for ; Wed, 04 Feb 2015 03:02:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EuNc5MElqUq4UcfOsxpOQhR/HK35qbGC1DJsUIMqkmo=; b=UHMwHuax01luKyTTGL1yznfqxBdqo2afc39trOzHNuDBq7zR4SuQgkULPpnsnGMsve Pbxp8ElwEc6hyZ1b79xdQIt8/rrrsf1EYvpFYJHBso0qlMs1dWkxFazeH4jEokfJIMlW A5FrGV/5ksk5Yjq7R6R92226ro/TVlA3my0IRP45nSVbquryCMK6HYoowKezaFR72yyt jjTjLQuB7xzLjMJlI+1TSx6HlNlf7LdOqo8i/G0IPagZOcJiXKx4aF1MSktD3sSxG+gW skQUGCn5Dx59tOCqVzPJbfJEzHqPMDnygT6zsIyNhSua0jZISRe0rJUP0t6mFslprTbj Y2QA== X-Gm-Message-State: ALoCoQkjud5DHtISBUZWT3OSyEBgfdC952vp98Vr0eiwdWx8BhyRwAWwYrYrz/BEIkquX+GS0xnX MIME-Version: 1.0 X-Received: by 10.42.205.134 with SMTP id fq6mr1099367icb.91.1423047755527; Wed, 04 Feb 2015 03:02:35 -0800 (PST) Received: by 10.64.229.5 with HTTP; Wed, 4 Feb 2015 03:02:35 -0800 (PST) X-Originating-IP: [82.122.90.239] Received: by 10.64.229.5 with HTTP; Wed, 4 Feb 2015 03:02:35 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Feb 2015 12:02:35 +0100 Message-ID: To: Leigh Cc: PHP Internals Content-Type: multipart/alternative; boundary=20cf303ddd54f7af1f050e411fe9 Subject: Re: [PHP-DEV] What do we need strict scalar type hints for? From: florian@margaine.com (Florian Margaine) --20cf303ddd54f7af1f050e411fe9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Leigh, Le 4 f=C3=A9vr. 2015 11:50, "Leigh" a =C3=A9crit : > > What was wrong with: > > function x(int $y, string $z) { // strict > function x((int) $y, (string) $z) { // casting > > This was the best suggestion I've seen that covers the requirements of > both camps, and is still very clear how data is going to be handled. > > Authors who want their APIs to adhered to strictly can do that, > authors who want to accept anything and have it end up as their > desired type can do that too. Because it is then the callee who decides, not the caller, whether or not he wants strict typing. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Cheers, Florian Margaine --20cf303ddd54f7af1f050e411fe9--