Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77204 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87048 invoked from network); 15 Sep 2014 00:31:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2014 00:31:07 -0000 Authentication-Results: pb1.pair.com header.from=leverton@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leverton@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: leverton@gmail.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:59587] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/D2-64534-A4336145 for ; Sun, 14 Sep 2014 20:31:07 -0400 Received: by mail-lb0-f181.google.com with SMTP id z11so3520266lbi.40 for ; Sun, 14 Sep 2014 17:31:03 -0700 (PDT) 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 :cc:content-type; bh=WHhx18UnWMmdWXRUL5ZNjpgBygQU3Nh3RGHpncnqEns=; b=x7RULU313l+eHVsgh2u3sW+6Js4t9U3FbmobUq4nrTzGFpb+kx7Ovwq+t/wBCuAds7 rf743Dr1qzWnHcxtef3TkmNLz7KenGSYCRjjYrIkKJxyiVnL+wQvXir0UYTVctpo3gXW dRRTG7qyU/g+HVxOqgHf4EBRrUBnz/hMkdikahlxZ4m95RGnLcjOWKnNQh5KSHKAwBxG CevNPZR1h5zbVj4EoEhj7jdmv3P/E5NljWIeyZ3W0P26F6ZsVpZrM1YRj+t47iMXN+aN rGANfU5gohNpPWXFP+edK6PmUaqyto8+HzwSl2jYsqte8xlcuVzRf1DTld+XWHuO+q1E uutg== MIME-Version: 1.0 X-Received: by 10.112.62.200 with SMTP id a8mr22855061lbs.34.1410741063116; Sun, 14 Sep 2014 17:31:03 -0700 (PDT) Received: by 10.112.158.66 with HTTP; Sun, 14 Sep 2014 17:31:03 -0700 (PDT) In-Reply-To: References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> <20140914000718.GB14312@phcomp.co.uk> <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> <54153692.7050500@sugarcrm.com> <9CE963B0-E624-4267-BC2A-0F8D1F985DAE@ajf.me> <6f2236e18c61d30b247e1c6bb2de10f1@mail.gmail.com> <807E0A88-3643-4EE0-B96E-B779903CF163@ajf.me> Date: Sun, 14 Sep 2014 19:31:03 -0500 Message-ID: To: Derick Rethans Cc: Andrea Faulds , Zeev Suraski , Stas Malyshev , PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: leverton@gmail.com (Matthew Leverton) On Sun, Sep 14, 2014 at 3:22 PM, Derick Rethans wrote: > We can either have casting where: > > function bar(int $foo) { } > bar("42"); > > Means the same as: > > function bar($foo) { } > bar((int) "42"); > > Or we can have it as a strict cast, or we can have it like it currently > (ie, not at all). I can live with those three options, but not an > option where casting/checking does something different again. > I totally agree with this. I can understand any of the following: 1) function f(int $a) { } == f( (int) $a); -- with NO notices 2) function f(int $a) {} means $a must be exactly type int -- or recoverable error is thrown 3) current behavior (no scalar type hints) But a new set of rules that require a 23x7 table to describe what's going on ... not a big fan. -- Matthew Leverton