Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81849 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30398 invoked from network); 5 Feb 2015 00:37:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 00:37:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.214.169 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:37646] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/DF-40930-83BB2D45 for ; Wed, 04 Feb 2015 19:37:13 -0500 Received: by mail-ob0-f169.google.com with SMTP id wp4so4555804obc.0 for ; Wed, 04 Feb 2015 16:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2gurZwmEJyaDaZetoGkI/AZSNzr/6AAb9wFLceXO0mQ=; b=cDhC79LRmUyNnJFQwauESD5BzZTIRRL9jTl93kFSx3P2ftoN21pl8FiC5p663M2zQZ LVF5YaLlJqhYhpolaWjWxpBCc+8X4VZDF0Vxvn30RoY727hF5IiwdCcQfcTQGbywC/sb oTdxQdV0gRQURtYI4XxMi+u5qQZdzKor+XUZ4= 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=2gurZwmEJyaDaZetoGkI/AZSNzr/6AAb9wFLceXO0mQ=; b=f0hZyV0NfVSvSy8WxQ8Soe4d3Mh2zNLu/qR/1WXu8yBf95jgKY9TVgYEadQa+UdMAT xWBaKHLgOruXlXEfizUo7xJhRcwt0jjLBs86p1agBs4s8ABsBvTxZNBY9ex/bTt6KgMK +v5p6M3wa4p4cf3nXcD0w/qQpx2C5ubz1odo+i35LfTxOTLwVPj+aehYpT6iqgt89yk/ K7IHE9M8KvRlgYuFxOyAmZ8YcLtRAJ/tRIC39haJopS6IeJoCHlG45uSYvdQ92MDTnz6 MF23K5+es8bwqd98k4zAHJVucSXGOEbUveF4s0N5Mzcjq5E9786XndVCCAKPjbymY93T 4giw== X-Gm-Message-State: ALoCoQna2hh9KVYXnQ8lxiz7nz361SvGk46e2W+00DeoROhoYyThdMp3wWHJoQZGDprEjY2Y/627 MIME-Version: 1.0 X-Received: by 10.182.199.70 with SMTP id ji6mr653045obc.3.1423096629672; Wed, 04 Feb 2015 16:37:09 -0800 (PST) Received: by 10.202.214.205 with HTTP; Wed, 4 Feb 2015 16:37:09 -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 02:37:09 +0200 Message-ID: To: Stanislav Malyshev Cc: Sebastian Bergmann , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] What do we need strict scalar type hints for? From: narf@devilix.net (Andrey Andreev) Hi, On Thu, Feb 5, 2015 at 2: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. Adding another concept, not changing the existing ones. And really, it's just simplifying what is already present via is_() runtime checks, making our lives a little bit easier. Though, I should re-iterate - I'm not in favor of picking just one of the two possibilities. > 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. Cheers, Andrey.