Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81848 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26978 invoked from network); 5 Feb 2015 00:06:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 00:06:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.50 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.50 mail-pa0-f50.google.com Received: from [209.85.220.50] ([209.85.220.50:49692] helo=mail-pa0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/7F-40930-804B2D45 for ; Wed, 04 Feb 2015 19:06:32 -0500 Received: by mail-pa0-f50.google.com with SMTP id rd3so5946492pab.9 for ; Wed, 04 Feb 2015 16:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=cDeIKdaZX5hGbPOKMJVduXUaDyFaR8d/StB0qF2LUcI=; b=jhHlY3OIG1GsvQBu4PoCNWPPvy3CjhK/UFFUvNKqV1iWowLj9sHrZk1dtub8uMgyXz isxMx3BFuZy7i9BRYaZPTBSo3WnPDUpZdEBPZfQUrR929kPO5QCoIyx8jDd0RFIgNm2y ZSwgiAXQ+7+679D1K38CJGqfLcvR3wceIZk640/XLj/Tf5E6O3yxzU8FPokoB1NCsW1S xJsD0XGjgKMof8d5v3DeyScHNN4Dt35C23oF+QSs0/kNrjnBZB2jVKrTthgHNZ+jggl9 mdq/tvAxuvF4mmqq+qiSk4pEX/sSsDrFhU6NmfmWtbyk4liIOaPdhbBScAcF0CDdTEfj OCOA== X-Received: by 10.66.141.176 with SMTP id rp16mr36601pab.11.1423094790045; Wed, 04 Feb 2015 16:06:30 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ua7sm3161429pab.37.2015.02.04.16.06.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 16:06:29 -0800 (PST) Message-ID: <54D2B3FA.6020900@gmail.com> Date: Wed, 04 Feb 2015 16:06:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Sebastian Bergmann , internals@lists.php.net References: <00c101d04049$ca411ec0$5ec35c40$@tekwire.net> <54D1CA7C.8060204@php.net> <54D1E6EC.7060702@php.net> In-Reply-To: <54D1E6EC.7060702@php.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] What do we need strict scalar type hints for? From: smalyshev@gmail.com (Stanislav Malyshev) 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