Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82271 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28514 invoked from network); 9 Feb 2015 11:26:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2015 11:26:51 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:51788] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/BF-50460-97998D45 for ; Mon, 09 Feb 2015 06:26:51 -0500 Received: by mail-we0-f176.google.com with SMTP id x3so1239739wes.7 for ; Mon, 09 Feb 2015 03:26:47 -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=2uCbYLwVStoXm+9Ea2f6fOYeinEtglx3oGo8QGnIHhs=; b=u99AIDdoj7z6h5i0YZ5sitw+LOYuSUxMD4aA3Mxje391H4dWWALIfMxaC4D41VQ4ig hmETnOKd41PlqoIOdyK+bcoI/F3udKgtCsxc9xOjX4lFkSC1fInd8xzwEowsT4Sv32bP YBomN8Go9yPyJK5bnPQXF4TuHSYXzz78ofExhj+OiRQg6MqYH4d9eFnHvyDGBEBj+2nu KeuVTQf61IBjY1Kmq/5qxA3SbZfObogKeHQ+0c1syFua9C0aaCGPOR/m6SF9R7136XH6 IuMrHcCeLqvDOGs+8KykqdLHzIzEtPiRRKAygodEN8Z4g8DeAocE91dOc6Z7CpqSmHOV OI7w== X-Received: by 10.180.74.6 with SMTP id p6mr34034524wiv.17.1423481206860; Mon, 09 Feb 2015 03:26:46 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id n1sm13992321wib.11.2015.02.09.03.26.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Feb 2015 03:26:46 -0800 (PST) Message-ID: <54D89959.6060904@gmail.com> Date: Mon, 09 Feb 2015 11:26:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: PHP internals References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <048c002a67c3d75afd802025b6946362@mail.gmail.com> <54D7F1AB.1070302@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC From: rowan.collins@gmail.com (Rowan Collins) Pierre Joye wrote on 09/02/2015 00:05: > On Mon, Feb 9, 2015 at 6:30 AM, Rowan Collins wrote: >> On 08/02/2015 20:33, Zeev Suraski wrote: >>> FWIW, while I think strict types - stricter than even strict languages - >>> don't belong in PHP, this syntax is clearly a step up from declare(), >>> which >>> was definitely not intended for this purpose. >> >> I'm kind of intrigued what purpose it *was* intended for. I've always found >> it a rather odd part of the language, but this seems as logical a use for it >> as any. >> >> For years, it had exactly one "execution directive", which worked in concert >> with a runtime event handler (ticks=N + register_tick_function). In PHP 5.3, >> a completely unrelated directive was added, to specify the encoding of the >> file (something that more obviously has to be detected by the compiler). >> >> Was there an original idea of what it would be used for that never came to >> fruition? Or is there something I'm missing that connects "ticks" and >> "encoding", but excludes "strict_types"? > Both are being done at compile time and modify how a file is compiled. > So no, I do not agree with "runtime" here, while one directive is > being used at runtime. I didn't say it was runtime, I said it "worked in concert with" runtime code. My point was that declare(encoding) is something purely internal to the compiler, affecting how it parses the file, whereas declare(ticks) is using the compiler to change the actual execution of the code, which makes them feel very different in effect. It's quite hard to generalise from those two examples to any real "vision" of declare()'s purpose, so I was genuinely curious what that vision was. Regards, -- Rowan Collins [IMSoP]