Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81806 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97188 invoked from network); 4 Feb 2015 10:49:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2015 10:49:52 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.173 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:55399] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/B8-55046-F49F1D45 for ; Wed, 04 Feb 2015 05:49:52 -0500 Received: by mail-wi0-f173.google.com with SMTP id r20so30794659wiv.0 for ; Wed, 04 Feb 2015 02:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=K6sbSQm87RAkAwUKBgm1rmU8QUIow8AhQbMCTWpqyls=; b=I2dwow7lKvY3mMvmPChaBjDSLPV7DyUXNTyR5+IC9Uk3IUrq7qGHDaB1FOG2ZXMzxW XEEB+k6IP2eZc/7h8oyJuwnQQPF3Uj8E4DdT2gJVFvHVLn0qg25XF2H9gjtVX1oHSgav uMR8i/CEAmR0oNaQAzsHrsJ1iVJ6/MSujy79gMoI5iH8erZ0+xahtPZHZ87Fwgq7vU+k B8idwNbCS9tzExHSRARaB/dJEifstdMkqVfMvPHD+9TzJ58fmzuuqVJpw8ML1SF8GCqF cnC3CXn2JkdAb/6J/fYUWb5A8W2g949UuoghRJMKnMfm39N83pxjiPttJDa4DgoW0/zA o04Q== MIME-Version: 1.0 X-Received: by 10.180.105.66 with SMTP id gk2mr3196388wib.30.1423046988719; Wed, 04 Feb 2015 02:49:48 -0800 (PST) Received: by 10.216.50.139 with HTTP; Wed, 4 Feb 2015 02:49:48 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Feb 2015 10:49:48 +0000 Message-ID: To: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] What do we need strict scalar type hints for? From: leight@gmail.com (Leigh) 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.