Dear PHP internals,
this is my first RFC proposal and I am not sure if in this email is supposed to contain all RFC details or just a brief idea .. which is to drop PHP constants in favour of “final" immutable variables.
This is basically only a concept but I can also handle its implementation.
Please let me know if I have to provide any additional details.
Regards,
Tim
Hi Tim,
I imagine you're proposing to drop class constants only, not PHP constants ? If you want to drop PHP constants, stop wasting your time on this :)
While that's the place to discuss it before you start an RFC, the concept is a little short.
Could you give at least syntax examples and, most important, the migration path you imagine : would you keep supporting current constants, would you deprecate them, the BC breaks it would introduce...
If you don't provide this, none can tell you if it has a chance.
Regards
François
-----Message d'origine-----
De : Tim Bezhashvyly [mailto:tim.bezhashvyly@gmail.com]
Envoyé : mardi 17 février 2015 18:35
À : internals@lists.php.net
Objet : [PHP-DEV] RFC ProposalDear PHP internals,
this is my first RFC proposal and I am not sure if in this email is supposed to
contain all RFC details or just a brief idea .. which is to drop PHP constants in
favour of “final" immutable variables.This is basically only a concept but I can also handle its implementation.
Please let me know if I have to provide any additional details.
Regards,
Tim
Dear PHP internals,
this is my first RFC proposal and I am not sure if in this email is supposed to contain all RFC details or just a brief idea .. which is to drop PHP constants in favour of “final" immutable variables.
I think we need some more details.
Assuming since you mention "final" that your intent is to allow
T_FINAL
for class property definitions?
Class constants have the ability to be referenced without
instantiating the class as an object. What are the benefits of
immutable properties over class constants? You certainly wont be able
to drop class constants as they are so widely used.
2015-02-17 20:35 GMT+03:00 Tim Bezhashvyly tim.bezhashvyly@gmail.com:
this is my first RFC proposal and I am not sure if in this email is
supposed to contain all RFC details or just a brief idea .. which is to
drop PHP constants in favour of “final" immutable variables.
Hello, Tim
Recently, I asked this question on internals
http://www.serverphorums.com/read.php?7,1123371 about immutable variables
and objects. Please, continue it if you want to discuss it, this will keep
the context of thread in one place.
However, no need to drop constants, but only to add an additional behavior
for objects and variables.
Thanks!
On Tue, Feb 17, 2015 at 8:35 PM, Tim Bezhashvyly tim.bezhashvyly@gmail.com
wrote:
Dear PHP internals,
this is my first RFC proposal and I am not sure if in this email is
supposed to contain all RFC details or just a brief idea .. which is to
drop PHP constants in favour of “final" immutable variables.
I think dropping constant or class constants is a bad idea.
Adding immutable variables may make sense, but you should explain
use-cases, behavior, syntax, implementation details, etc
Thanks. Dmitry.
This is basically only a concept but I can also handle its implementation.
Please let me know if I have to provide any additional details.
Regards,
Tim
Dear internals,
my RFC was not about dropping just class constants but constants in general. Now I realise that you are not ready for this and most likely will never be. Thus I’m withdrawing my proposal.
Regards,
Tim
Dear PHP internals,
this is my first RFC proposal and I am not sure if in this email is supposed to contain all RFC details or just a brief idea .. which is to drop PHP constants in favour of “final" immutable variables.
I think dropping constant or class constants is a bad idea.
Adding immutable variables may make sense, but you should explain use-cases, behavior, syntax, implementation details, etcThanks. Dmitry.
This is basically only a concept but I can also handle its implementation.
Please let me know if I have to provide any additional details.
Regards,
Tim
Hi Tim,
As I already told you, you should proceed step by step. Implementing immutable properties and removing constants is just a too big step. And, IMO, one may pass, while the second one has no chance, especially if you propose to remove PHP constants as well as class constants, without a BC layer. Unfortunately, while we can sometimes break BC, we are not designing from scratch.
Now, if you want to link both features and withdraw the whole, that's your choice, and none will blame you for that. You were asking for opinions that's only mine.
Regards
François
-----Message d'origine-----
De : Tim Bezhashvyly [mailto:tim.bezhashvyly@gmail.com]
Envoyé : mercredi 18 février 2015 10:44
À : PHP Internals
Objet : Re: [PHP-DEV] RFC ProposalDear internals,
my RFC was not about dropping just class constants but constants in general.
Now I realise that you are not ready for this and most likely will never be.
Thus I’m withdrawing my proposal.Regards,
TimOn Tue, Feb 17, 2015 at 8:35 PM, Tim Bezhashvyly
<tim.bezhashvyly@gmail.com mailto:tim.bezhashvyly@gmail.com> wrote:
Dear PHP internals,this is my first RFC proposal and I am not sure if in this email is supposed to
contain all RFC details or just a brief idea .. which is to drop PHP constants in
favour of “final" immutable variables.I think dropping constant or class constants is a bad idea.
Adding immutable variables may make sense, but you should explain use-
cases, behavior, syntax, implementation details, etcThanks. Dmitry.
This is basically only a concept but I can also handle its implementation.
Please let me know if I have to provide any additional details.
Regards,
Tim
Hi Tim,
Le Wed, 18 Feb 2015 10:44:20 +0100, Tim Bezhashvyly
tim.bezhashvyly@gmail.com a écrit:
Dear internals,
my RFC was not about dropping just class constants but constants in
general. Now I realise that you are not ready for this and most likely
will never be. Thus I’m withdrawing my proposal.Regards,
Tim
I'm totally against dropping the constants. Constants are one of the first
things you learn in PHP, and they are literally everywhere. This would be
a major BC. Even worse than DbC, return types and scalar type hints
altogether. But the immutable variables are interesting.
As other people said, you should proceed step-by-step. I can perfectly see
the immutable variables pass, but not the removal of the constants.
You should explain precisely what you have in mind, so we can discuss it.
Dear internals,
after cooling down and encouraged by François (thank a lot for this) I decided to submit an RFC regarding immutable variable only. Would appreciate if you will grant me some karma to do it.
Regards,
Tim
Dear internals,
my RFC was not about dropping just class constants but constants in general. Now I realise that you are not ready for this and most likely will never be. Thus I’m withdrawing my proposal.
Regards,
TimDear PHP internals,
this is my first RFC proposal and I am not sure if in this email is supposed to contain all RFC details or just a brief idea .. which is to drop PHP constants in favour of “final" immutable variables.
I think dropping constant or class constants is a bad idea.
Adding immutable variables may make sense, but you should explain use-cases, behavior, syntax, implementation details, etcThanks. Dmitry.
This is basically only a concept but I can also handle its implementation.
Please let me know if I have to provide any additional details.
Regards,
Tim
Tim Bezhashvyly wrote:
after cooling down and encouraged by François (thank a lot for this)
I decided to submit an RFC regarding immutable variable only. Would
appreciate if you will grant me some karma to do it.
Have you already registered for a Wiki account on
https://wiki.php.net/?do=register?
--
Christoph M. Becker