Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81800 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86638 invoked from network); 4 Feb 2015 10:13:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2015 10:13:50 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.173 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.173 mail-vc0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:55720] helo=mail-vc0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/96-55046-DD0F1D45 for ; Wed, 04 Feb 2015 05:13:50 -0500 Received: by mail-vc0-f173.google.com with SMTP id id10so210934vcb.4 for ; Wed, 04 Feb 2015 02:13:46 -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=IYdZwtyiz8cev1gHZhKMLP0f5AI1RppKDw0NRlW1C7E=; b=UTINYwGn5soyvfGjlHcRcXgwoNhC/KC8mJ6IhDF8GeP0tpP0UQ56TW94xtJRvEZmya +C9st2C9hvrzPi6UJm7Oke8x26mEFeC8YvZF44xP1Ol+o8VDeNYZMwIFt+99j7emv+i2 5A2jTW2GYWAbjdG5+fS55+/yfJBozaFLdXnVo2q5SkKVZZ+ruoeWbrsuGw+uMFQpwgp/ I8zEngU6G505wn/BXzHrh03317Sq7RYz+lVkdXbgkiFe/VGGsLUB9eIGE/M6z2Tiy+LU aENTpHCT4mh6soEoM2M7V9oYywNqYUfJK8b6PYdaNa6GH3QwGOSDdqhOJsazXIkt7q9I O1Bg== X-Gm-Message-State: ALoCoQmIXioHWO4ZULVDWByshnzy5Z1WOhVcNeeybx9mQxDb79dK7NkVdpLp5Nhqk+7010oPtLHjCH0rWYdZ/G30W8sL9tLypnf3zXtznLnFM1BBNptZQ3FSNyG7diY0D/9s4YGsu0RVOj1WdhjZZ7amcZSJ1kl2Tw== MIME-Version: 1.0 X-Received: by 10.52.52.136 with SMTP id t8mr15670775vdo.49.1423044826521; Wed, 04 Feb 2015 02:13:46 -0800 (PST) Received: by 10.52.74.73 with HTTP; Wed, 4 Feb 2015 02:13:46 -0800 (PST) In-Reply-To: <54D1E6EC.7060702@php.net> References: <00c101d04049$ca411ec0$5ec35c40$@tekwire.net> <54D1CA7C.8060204@php.net> <54D1E6EC.7060702@php.net> Date: Wed, 4 Feb 2015 14:13:46 +0400 Message-ID: To: Sebastian Bergmann Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e0115f0486278ee050e407189 Subject: Re: [PHP-DEV] What do we need strict scalar type hints for? From: dmitry@zend.com (Dmitry Stogov) --089e0115f0486278ee050e407189 Content-Type: text/plain; charset=UTF-8 This won't fit into "loosely-typed" PHP, and will lead to writing - sin((float)$x). We have this in PHP sources :) (in C) Thanks. Dmitry. On Wed, Feb 4, 2015 at 12:31 PM, Sebastian Bergmann wrote: > Am 04.02.2015 um 10:25 schrieb Dmitry Stogov: > > Do you like the proposal with declare() switch? > > No, I do not like that. > > We are talking about adding support for scalars (string, integer, ...) > to the list of optional type declarations already supported (array, > callable, interface name, class name) by PHP. When a developer chooses > to use a scalar type in the signature of a function or method then it > should be enforced as strictly as the already supported types. It should > be up the caller to perform explicit type casting when required. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e0115f0486278ee050e407189--