Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80554 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 972 invoked from network); 15 Jan 2015 15:58:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 15:58:06 -0000 Received: from [127.0.0.1] ([127.0.0.1:23996]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 20/BE-14306-11DD7B45 for ; Thu, 15 Jan 2015 10:30:25 -0500 Authentication-Results: pb1.pair.com header.from=dennis@birkholz.biz; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dennis@birkholz.biz; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain birkholz.biz does not designate 144.76.185.252 as permitted sender) X-PHP-List-Original-Sender: dennis@birkholz.biz X-Host-Fingerprint: 144.76.185.252 mx01.nexxes.net Received: from [144.76.185.252] ([144.76.185.252:47306] helo=mx01.nexxes.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/5E-14306-7EBD7B45 for ; Thu, 15 Jan 2015 10:25:29 -0500 Received: from [137.226.183.192] (ip3192.saw.rwth-aachen.de [137.226.183.192]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: db220660-p0g-1@packages.nexxes.net) by mx01.nexxes.net (Postfix) with ESMTPSA id 7B925480A17 for ; Thu, 15 Jan 2015 16:25:24 +0100 (CET) Message-ID: <54B7DBE4.6000103@birkholz.biz> Date: Thu, 15 Jan 2015 16:25:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> In-Reply-To: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: dennis@birkholz.biz (Dennis Birkholz) Hello together, I have followed the discussion from the outside (as I am not to vote here) but I am a (not representative) PHP developer. I think the main problem here is that you mix two things up: 1. Scalar type hints for functions 2. Conversion rules From what I have read, most of you agree that scalar type hints for functions are really useful. If you define function foo(int $i) you don't want is_int-checks and throw InvalidArgumentExceptions. The real controversy is about what variables can be passed to the type hinted functions. And that falls into 2) There seem to be two types of conversion currently present in the code: - the one used for arguments of build-in/extension functions max("1", 2.0); - the one used for implicit conversion in php code $i = "1" + 2.0; The discussion now revolves around: which of both conversions is right if I typehint my pure PHP function? Or are both wrong? I feel there should be a separate RFC that addresses a unification of implicit conversion rules and that matter should not be in the type hinting discussion. Thanks for listening, Dennis Birkholz