Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81866 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78529 invoked from network); 5 Feb 2015 06:52:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 06:52:37 -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.171 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.171 mail-vc0-f171.google.com Received: from [209.85.220.171] ([209.85.220.171:44705] helo=mail-vc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/04-51979-33313D45 for ; Thu, 05 Feb 2015 01:52:35 -0500 Received: by mail-vc0-f171.google.com with SMTP id hq11so2164431vcb.2 for ; Wed, 04 Feb 2015 22:52:32 -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=GB/WSaVs/G7JeAbgHtFivtMNqm7bhGeussDs2CjukzY=; b=ccmAhZG6Z4lSkFOEQ/u8LY5xPU57//QY22+Paud1ovFw39g6xm65NC37wbN5pM8QyX 7DEI0p+HulWyt1e2te5Snu0Gl8M6tYRYh/cJ6NIENeMcrtNM+B85EpUbH1qJC+h4F37K PRchB46BRZciJIat6ws1cDGWOYYcMHCg4R5VlF+VEw6pkGxGpshnSJCfaSwhNC4jdnof 8CQR/PGNx1eZyeKm2IC9wh9hz/wat28bJi1+44i8sSeln67NFriuz96YZutzYDcpyfkj PrNnQSl3cPCxzrdUNdW5TORSa1aoydF8w5dHKFfMKwsmqa2lcbZQVbgum3H0ElTCLvTm p7SQ== X-Gm-Message-State: ALoCoQndCNumCxMQXDtoQfxZ348YFQPAGjEc/GL6kLtRRjRjJRCAoHqE4BRVKVC92uCdGp1KKh11JvsDxxgD3V1CRKCIgw2/FcgzG2LQ11eOWLfWMeFKjtjDENSu5TB5hduOfLlnhH8nwQ1rrHvlCZFVQ1fdyOThVQ== MIME-Version: 1.0 X-Received: by 10.221.18.136 with SMTP id qg8mr831213vcb.27.1423119152829; Wed, 04 Feb 2015 22:52:32 -0800 (PST) Received: by 10.52.74.73 with HTTP; Wed, 4 Feb 2015 22:52:32 -0800 (PST) In-Reply-To: <54D2B3FA.6020900@gmail.com> References: <00c101d04049$ca411ec0$5ec35c40$@tekwire.net> <54D1CA7C.8060204@php.net> <54D1E6EC.7060702@php.net> <54D2B3FA.6020900@gmail.com> Date: Thu, 5 Feb 2015 10:52:32 +0400 Message-ID: To: Stanislav Malyshev , Andrea Faulds Cc: Sebastian Bergmann , PHP Internals Content-Type: multipart/alternative; boundary=001a113399e693f153050e51bf23 Subject: Re: [PHP-DEV] What do we need strict scalar type hints for? From: dmitry@zend.com (Dmitry Stogov) --001a113399e693f153050e51bf23 Content-Type: text/plain; charset=UTF-8 I completely agree. Strict typing doesn't fit into PHP. It was already told thousand times. Check the second requirement in RFC template https://wiki.php.net/rfc/template Also, the only really useful case for "strict typing" is the ability to catch mistakes in user apps. However, this ability is really limited. Implementing "Design by Contact" approach may be much smarter. Thanks. Dmitry. On Thu, Feb 5, 2015 at 3:06 AM, Stanislav Malyshev wrote: > Hi! > > > 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. > > That is contrary to the nature of PHP as it has been a weakly typed > language for 20 years. I think it would be a big mistake to change one > of the basic concepts of the language, that has worked pretty well > judging from it adoption. Especially given that all internal functions > do not and will not work this way. Unless you propose make internal > functions work this way too, in which case it'd be much better to change > the name of the project, because there won't be much left that connects > it to prior PHP and you can pretty much forget about BC. > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113399e693f153050e51bf23--