> From: Patrick ALLAERT <patrickalla...@php.net>
> Sent: Thursday, June 21, 2018 18:25
> To: Nikita Popov <nikita....@gmail.com>
> Cc: PHP internals <internals@lists.php.net>
> Subject: Re: [PHP-DEV] [RFC] Typed Properties
>
> My only concern is about regular variables, not bound to any classes. Isn't
> that a little bit inconsistent that classes properties could be typed, but 
> not a
> regular variable in the middle of a function/method/plain "script"
> file?
> 
> I would see some benefit doing something like:
> 
> string $content = file_get_contents("/foo/bar");
> 
> (Sorry if this has been raised already in the past)
> 
> Patrick

Hey Patrick,

It is an option to allow this in future, but for now I consider this too far 
out of scope, possiv and it will, in particular also require greater changes to 
the engine - I guess it would about double the size of the patch again. (and 
this patch is already everything, but small.)

This feature would as well be possibly not uncontroversial, needs thinking 
about the scoping of the variable type (Lifetime until unset()? Lifetime until 
function end? etc.) - I definitely would not go too far with this RFC. The 
topic is typed properties and that's what the scope of the RFC shall also be.

Bob

Reply via email to