Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82980 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81991 invoked from network); 17 Feb 2015 16:25:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 16:25:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=j.boggiano@seld.be; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=j.boggiano@seld.be; sender-id=pass Received-SPF: pass (pb1.pair.com: domain seld.be designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: j.boggiano@seld.be X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:49729] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/B2-19463-E7B63E45 for ; Tue, 17 Feb 2015 11:25:35 -0500 Received: by mail-wi0-f172.google.com with SMTP id l15so34758995wiw.5 for ; Tue, 17 Feb 2015 08:25:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=HKvV8WxBzRgeY4z07+dwJfjx2sONwM+iBMKsCg0l3UI=; b=hQ8jtYhnzwb5a1jPes/Vy2Wz31CMafhSlbOORDkNAvdRgy0ko21qdcZNHmsYMu7e1f ZZ5djwNcoJjKWtHOskZOHMlUj561oUIZ5ha5Bd8/LGDFGx8lT47uBvPCQFmiwefFEkKG u87mVK2Wi4tztQ0AN8b8QsIvOyuGsv6c1znjA+K/G+hOrqxK+cmK8jjobtzJrTvMDogF YAw9NBImJS4XiDkze+A+8iz8Rqf9YJlwd4in/dpDEi4AOMeFxUkZUomPzwOZrpF9qaZ4 h5BsoQuCJcMZCyGDWHY3oA1wto+DkqKN3wA8qF5JqwhJoTLPCnrPFbktA0o87dB98/ty rCmw== X-Gm-Message-State: ALoCoQkDGqylObUj9a6I5yvbJEPrNXvyHgJyZA3Dc72BAlpEkZTPIKBQoJR4QGArJxqaUHWiaP7U X-Received: by 10.180.126.98 with SMTP id mx2mr58335726wib.18.1424190331607; Tue, 17 Feb 2015 08:25:31 -0800 (PST) Received: from [192.168.1.67] ([212.56.104.215]) by mx.google.com with ESMTPSA id ax10sm28081761wjc.26.2015.02.17.08.25.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 08:25:30 -0800 (PST) Message-ID: <54E36B7D.9070502@seld.be> Date: Tue, 17 Feb 2015 16:25:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <011801d04a07$83ab1c00$8b015400$@php.net> <016f01d04a3a$e9183220$bb489660$@php.net> <022801d04ab1$4a0c47d0$de24d770$@php.net> <1913e09d7f52541901d8574d2080a63f@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Reviving scalar type hints From: j.boggiano@seld.be (Jordi Boggiano) On 17/02/2015 15:47, Anthony Ferrara wrote: > If we want to add a "numeric" type as a virtual union of int and > float, that's one way to solve the concern. If we don't, we could also > allow widening primitive conversion (int -> float). That wouldn't work > well with bigints, but would be fine in other cases. But there are > plenty of languages that always require explicit type conversion. So > even if we choose that, we're in good company. As far as I understand, allowing int -> float would help fix a few of Rasmus' (or was it Benjamin?) concerns about things like sin() requiring floats in strict mode. It would make strict mode a lot more usable with C code as well. +1 on keeping the strictness benefits and remove some of the drawbacks. Having numeric in addition might be nice mostly for return values I guess, but it seems a bit redundant to me if int -> float is allowed. As for the straw poll, I also think declare() is the clearest syntax, especially if it's enforced to appear at most once and on top of the file to remove any potential misuses. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi