Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80556 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1060 invoked from network); 15 Jan 2015 15:58:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 15:58:09 -0000 Authentication-Results: pb1.pair.com header.from=j.boggiano@seld.be; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=j.boggiano@seld.be; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain seld.be designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: j.boggiano@seld.be X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:49478] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/BE-14306-52DD7B45 for ; Thu, 15 Jan 2015 10:30:45 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so18605215wiw.4 for ; Thu, 15 Jan 2015 07:30:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DJoF7r2EWQ2WV9U3kP/iwzPG6EpLPYnROF5tQz2YX2Q=; b=U5NH7geDRGUzYEpd8KqMcWMx2oFl3dnlJwYOwyqsHJBs+yafFahha7V254K0rSZk37 eY10jGt0mqIxxHnD5LNa7FN+0nAw1cK4Xf67dJoHWfC94OOefThkeTgqN2/bKp6IvXwb uyCsW0/+VydajJwhXtPfCPw0qD9PW/u3IafPJmW9JQsnXIEsvzlxwyvvd8UWcEuB2OjY JYiF2SpiN3vhsqLECor1MDZhYE6T15lUFK2zYOrzFlvSGTS3hU4zYp8Rv3W/HnYdKeUn +YrC1AF9j0L/+ujWHiQdL+m6ZeFBgsqUbPVau6fh5+wtcObfKrsXicUJqJ3c9vcM61gC N9QQ== X-Gm-Message-State: ALoCoQmgamNllu1zta6jZaKjt78FJM0Hiya0rV4+saLhkfxOHvISZLYjZ6m/uf2B1o4NYxKNoOkI X-Received: by 10.180.36.162 with SMTP id r2mr28149021wij.75.1421335841809; Thu, 15 Jan 2015 07:30:41 -0800 (PST) Received: from [192.168.1.66] (83.90.199.146.dyn.plus.net. [146.199.90.83]) by mx.google.com with ESMTPSA id c10sm2518606wjy.4.2015.01.15.07.30.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jan 2015 07:30:40 -0800 (PST) Message-ID: <54B7DD31.4090906@seld.be> Date: Thu, 15 Jan 2015 15:30:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: =?UTF-8?B?UGF2ZWwgS291xZlpbA==?= CC: PHP internals References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <54B7D8AE.5090209@seld.be> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: j.boggiano@seld.be (Jordi Boggiano) On 15/01/2015 15:25, Pavel KouĊ™il wrote: > The potential issues with this are pretty real, to be honest. Simple > things like moving a method from one class to another (let's say to > parent or descendant) and getting to another typing context may cause > unpredictable behavior if the user forgets to have declare() in both > files. Agreed there are gotchas but not only with declare(). Many things can go wrong when you move a function somewhere else, for example you might leave `use` statements behind and suddenly a `catch (FooException $e)` will fail to match exceptions or something sneaky like that. I don't necessarily think that's enough to kill the feature. Note that you can only get problems going from weak to strict context by the way, the other way around should not cause any issues, code would just work when it otherwise would have triggered strict errors. Since you usually move code into places you own, I'd assume you know it if you are using strict typing. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi