Re: Syntactical change to Scalar Type Hints RFC
| From: | Pierre Joye | Date: | Mon, 09 Feb 2015 00:05:39 +0000 |
| Subject: | Re: Syntactical change to Scalar Type Hints RFC | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82200@lists.php.net to get a copy of this message | ||
On Mon, Feb 9, 2015 at 6:30 AM, Rowan Collins <rowan.collins@gmail.com> 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.
--
Pierre
@pierrejoye | http://www.libgd.org