Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81607 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68808 invoked from network); 2 Feb 2015 16:48:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 16:48:29 -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.215.47 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:50634] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/27-34915-B5AAFC45 for ; Mon, 02 Feb 2015 11:48:28 -0500 Received: by mail-la0-f47.google.com with SMTP id hz20so42755844lab.6 for ; Mon, 02 Feb 2015 08:48:25 -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:content-transfer-encoding; bh=VgL1bpfzf93WK39NUMnQk0XtYRTtPcDBJAz/+wSVOfs=; b=Cd4Odc/1Es3DTXKHOasJm/Pq10tWzTWAsRaGA264v8mBS2My8Pr+tDTD2k4ONzVrFW mvyiOIx+mtit0D/d3soyGT27yaScDJB5DCkT4s++WjBi7X+FqQrptkb3/rW75b7f98GQ Npkj+ghjreJUBzDTnHfAN85y8YkHevvBc7Tyo= 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 :content-transfer-encoding; bh=VgL1bpfzf93WK39NUMnQk0XtYRTtPcDBJAz/+wSVOfs=; b=InCFvT8wW5RgG9OrHq0xYqb4YBw4WAO5Caa4WkquaUNE0fYkY2SeDoVIQLdkWfWQMF MF1efTmhHWM2vBMhkxtepGUR/D5Y+9gh4cJWVy56EeuSBtd09jIwECDJjFGpF62X3o9V ugCAZ3ZdKInFlje5LNfySyFRGkhuCqqVLquZJBHT82wHloL2PkyYDRmU1gLGL4JDMLAn beMHa9GKDpu8OdI3Y4xMPwySWwb2RWB1Dc7Y2K5S7LGOn0+fH0aVYP9Vo+XQOKO8u95h hJTOtivjKhK2gZyGYSRl2osNXc6imj8b0dqyMIADySFROSJrj6VGA3qDL8tUSt76V0v8 8cMQ== X-Gm-Message-State: ALoCoQny2TpkMuV2X0Y5QcNcGhg6mpS55Vo+oe0zz/4O4lzCwGxydAGTGUrnzsSf2hmoq5Dgyn4F MIME-Version: 1.0 X-Received: by 10.112.92.204 with SMTP id co12mr9596070lbb.43.1422895705238; Mon, 02 Feb 2015 08:48:25 -0800 (PST) Received: by 10.112.144.74 with HTTP; Mon, 2 Feb 2015 08:48:25 -0800 (PST) In-Reply-To: <6C58B302-C78A-490B-A333-4D1A71334E19@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <6C58B302-C78A-490B-A333-4D1A71334E19@ajf.me> Date: Mon, 2 Feb 2015 18:48:25 +0200 Message-ID: To: Andrea Faulds Cc: Derick Rethans , Dmitry Stogov , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: narf@devilix.net (Andrey Andreev) Hi, On Mon, Feb 2, 2015 at 6:39 PM, Andrea Faulds wrote: > Hey Derick, > >> On 2 Feb 2015, at 16:35, Derick Rethans wrote: >> >> On Mon, 2 Feb 2015, Dmitry Stogov wrote: >> >>> As I already told, in my opinion, version 0.1 was the perfect solution = that >>> fit into PHP semantic very well. >>> >>> declare(strict_types=3D1); - is really weird solution. >>> It changes type hinting behavior per file scope, so, just to try strict >>> type hinting in a big project, people will have to change every single = PHP >>> file. >> >> THis is why I believe it makes more sense to have this switch on the >> callee side, instead of on the calling side. > > That does have its advantages. But it also has some quite severe problems= . > > For starters, if you set that flag on the callee side, you just broke eve= rything that uses that function and passes the =E2=80=9Cwrong=E2=80=9D type= . That=E2=80=99s a migration headache. > > It also means that you don=E2=80=99t have any choice over strictness as t= he user of an API: some APIs are strict, others weak. That means three line= s of code might use three different approaches argument strictness. I don= =E2=80=99t like that terribly much. > As already said, we're just going around in circles at this point, but a migration issue? Whatever code using the scalar type hints should be *new* code in userland. You're basing your whole argument on the assumption that all internal functions would break with strict=3D1 ... nobody needs that and it doesn't have to be done. Cheers, Andrey.