Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-25 Thread Rowan Collins
On Sun, 23 Sep 2018 at 22:48, Nikita Popov wrote: > > There might be a compromise here, which is to only perform a ctor > initialization check and forbid explicit unset()s if the class does not use > property accessors (i.e. does not define __get). This allows the lazy > initialization pattern

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Nikita Popov
On Sun, Sep 23, 2018 at 10:08 PM Rowan Collins wrote: > On 23/09/2018 19:41, Claude Pache wrote: > >> 3) Object properties may be type hinted and the class author has until > the end > >> of the constructor to make sure they're fulfilled, otherwise TypeError > on the > >> spot (what I'm

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Rowan Collins
On 23/09/2018 21:50, Christoph M. Becker wrote: In my opinion, explicitly *declared* properties should not be unsettable. We don't allow to undefine constants, functions, classes etc. either. Adding and removing other properties could still be allowed. While I agree, I think that's a

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Rowan Collins
On 23/09/2018 19:31, David Rodrigues wrote: Em dom, 23 de set de 2018 às 13:09, Larry Garfield escreveu: 3) Object properties may be type hinted and the class author has until the end of the constructor to make sure they're fulfilled, otherwise TypeError on the spot (what I'm proposing).

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Christoph M. Becker
On 23.09.2018 at 22:07, Rowan Collins wrote: > On 23/09/2018 19:41, Claude Pache wrote: >> >>> 3) Object properties may be type hinted and the class author has >>> until the end >>> of the constructor to make sure they're fulfilled, otherwise >>> TypeError on the >>> spot (what I'm proposing). >>

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Robert Korulczyk
> Just to be sure you don’t miss the herd that this elephant is concealing: > > In addition, you *must* forbid unset() on those properties... Shouldn't we delegate the whole problem to object type resolving and make it more strict? Right now properties are not guaranteed at all - you can have

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Rowan Collins
On 23/09/2018 19:41, Claude Pache wrote: 3) Object properties may be type hinted and the class author has until the end of the constructor to make sure they're fulfilled, otherwise TypeError on the spot (what I'm proposing). Just to be sure you don’t miss the herd that this elephant is

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Lester Caine
Wrong reply button :( On 23/09/2018 07:18, Rasmus Schultz wrote: That is the entire point of the elephant analogy: that knowing what can get in doesn't necessarily mean knowing what is already inside - BUT, knowing what can get in may still useful in itself. I understood that, and I disagree

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Claude Pache
> > 3) Object properties may be type hinted and the class author has until the > end > of the constructor to make sure they're fulfilled, otherwise TypeError on the > spot (what I'm proposing). Just to be sure you don’t miss the herd that this elephant is concealing: In addition, you *must*

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread David Rodrigues
Em dom, 23 de set de 2018 às 13:09, Larry Garfield escreveu: > 3) Object properties may be type hinted and the class author has until the > end > of the constructor to make sure they're fulfilled, otherwise TypeError on > the > spot (what I'm proposing). > Item 3 could not be enough, for

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Larry Garfield
On Sunday, September 23, 2018 1:18:02 AM CDT Rasmus Schultz wrote: > > That is the entire point of the elephant analogy: that knowing what can > > get in doesn't necessarily mean knowing what is already inside - BUT, > knowing what can get in may still useful in itself. > > I understood that,

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Rasmus Schultz
> That is the entire point of the elephant analogy: that knowing what can get in doesn't necessarily mean knowing what is already inside - BUT, knowing what can get in may still useful in itself. I understood that, and I disagree - just knowing what can get in is not useful or interesting in

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-22 Thread Rowan Collins
On 22 September 2018 20:32:04 BST, Rasmus Schultz wrote: >if you read my last post (especially the last part) carefully, you'll >see >why this elephant analogy is incomplete. > >the issue is not whether or not something gets in - it's much more far >reaching than that. > >the issue is, once

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-22 Thread Larry Garfield
On Saturday, September 22, 2018 2:32:04 PM CDT Rasmus Schultz wrote: > Larry, > > this wasn't aimed at "you" personally, I'm just using the proverbial "you", > as in "not me". > > if you read my last post (especially the last part) carefully, you'll see > why this elephant analogy is incomplete.

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-22 Thread Rasmus Schultz
Larry, this wasn't aimed at "you" personally, I'm just using the proverbial "you", as in "not me". if you read my last post (especially the last part) carefully, you'll see why this elephant analogy is incomplete. the issue is not whether or not something gets in - it's much more far reaching

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-22 Thread Larry Garfield
Rasmus: Please be careful when you refer to "you" as wanting or doing something. I had no part in the patch design or implementation beyond saying "yay!" a few times on the list/twitter. "I" don't want a particular engine pseudo-type (uninitialized); I honestly don't care about that level of

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-22 Thread Rowan Collins
On 22/09/2018 11:15, Rasmus Schultz wrote: That is, it doesn't assert that a value IS a given type, but that it can only be SET TO a given type. That is literally the same thing - if it can only be set to a given type, it can only BE a given type. Consider this analogy: if I build a house

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-22 Thread Rasmus Schultz
I apologize for the long posts, but Larry asked me to comment on this. On Thu, Sep 20, 2018 at 5:52 PM Larry Garfield wrote: > I think the distinction here is that one group is arguing for "state of the > data assertions" while the RFC as implemented is "setter assertion shorthand". The point

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Larry Garfield
On Friday, September 21, 2018 10:25:50 AM CDT Rasmus Schultz wrote: > On Fri, Sep 21, 2018 at 10:24 AM Lester Caine wrote: > > Ignoring the debate on uninitialized/null ... not all objects ARE > > invariant > > hence nullable types. > > > and there are very good reasons for not setting values

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Christoph M. Becker
On 21.09.2018 at 17:25, Rasmus Schultz wrote: > this doesn't provide *any* additional guarantees: > > class Foo { > public int $bar; > } > > $foo = new Foo(); // invalid state allowed > > $foo->bar = 123; // valid state > > $foo->bar = null; // invalid state NOT allowed?! > > [snip] > >

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Rasmus Schultz
On Fri, Sep 21, 2018 at 10:24 AM Lester Caine wrote: > Ignoring the debate on uninitialized/null ... not all objects ARE > invariant hence nullable types. > and there are very good reasons for not setting values for > everything, but it seems that these types of object are deemed to be > 'bad

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Rowan Collins
On Fri, 21 Sep 2018 at 15:11, Larry Garfield wrote: > Perhaps another disconnect here is that, in practice, the consumer of an > object property is, in my experience, almost always "me". I almost never > have > public properties on my objects. On the rare occasion I do, it's for a > "struct

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Larry Garfield
On Friday, September 21, 2018 4:20:20 AM CDT Rowan Collins wrote: > On Thu, 20 Sep 2018 at 16:52, Larry Garfield wrote: > > I think the distinction here is that one group is arguing for "state of > > the > > data assertions" while the RFC as implemented is "setter assertion > > shorthand". > >

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Rowan Collins
On Thu, 20 Sep 2018 at 16:52, Larry Garfield wrote: > I think the distinction here is that one group is arguing for "state of > the > data assertions" while the RFC as implemented is "setter assertion > shorthand". > That is, it doesn't assert that a value IS a given type, but that it can > only

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Lester Caine
On 21/09/2018 08:58, Rasmus Schultz wrote: No matter how you twist it, uninitialized is the new null. I'm fine with unintialized as an implementation detail that ensures you can't read from properties while the constructor is busy establishing the invariant. I'm not at all fine with

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-21 Thread Rasmus Schultz
On Thu, Sep 20, 2018 at 4:50 PM Levi Morrison wrote: > > This will be my last reply to this thread. Fundamentally: > > class User { > public ?int $id; > public ?string $preferred_name; > public ?string $username; > } > > ^ This permits null properties at all times. This is

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Larry Garfield
On Thursday, September 20, 2018 6:50:45 AM CDT Rowan Collins wrote: > On Thu, 20 Sep 2018 at 11:58, Nikita Popov wrote: > > I do not consider it advisable to require a null initialization as a > > "first iteration" of the proposal. Regardless of what our intention might > > be, the effect of such

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Pedro Magalhães
On Thu, Sep 20, 2018 at 12:50 PM Rowan Collins wrote: > Encouraging people to use them gives them a false guarantee, and allowing > them to do so prevents us adding a stricter version of the feature later. > What exactly would prevent us from enforcing it in the future? The way I see it,

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Sara Golemon
On Thu, Sep 20, 2018 at 9:50 AM, Levi Morrison wrote: > This will be my last reply to this thread. > This will be my first and, God willing, only reply to this thread. > Fundamentally: > > class User { > public int $id; > public string $preferred_name; > public string $username; >

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Levi Morrison
This will be my last reply to this thread. Fundamentally: class User { public ?int $id; public ?string $preferred_name; public ?string $username; } ^ This permits null properties at all times. This is acceptable behavior if null is valid for the domain. It is not valid for this

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Rasmus Schultz
On Wed, Sep 19, 2018 at 10:04 PM Levi Morrison wrote: > I think this code should be allowed: > >class User { > public int $id; > public string $preferred_name; > public string $username; > } This code is broken - by making the properties non-nullable, you're

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Lester Caine
On 19/09/2018 22:58, Marco Pivetta wrote: Also, there are scenarios (discussed in typed properties v1) that make the uninitialized state actually favorable (every serializer ever, like every one, really). I still find a problem with this idea that everything must be initialized. If I am

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Rowan Collins
On Thu, 20 Sep 2018 at 11:58, Nikita Popov wrote: > I do not consider it advisable to require a null initialization as a > "first iteration" of the proposal. Regardless of what our intention might > be, the effect of such a restriction will not be "I'm not going to type > this property for now,

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Nikita Popov
On Wed, Sep 19, 2018 at 2:38 PM Rowan Collins wrote: > On Tue, 11 Sep 2018 at 08:05, Bob Weinand wrote: > > > Hey, > > > > As announced, we are starting the vote on typed properties today. > > > > The voting period is two weeks, until sometime in the evening on Tuesday > > 25-09-2018. > > > >

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-20 Thread Christian Stoller
> -Ursprüngliche Nachricht- > Von: Rowan Collins > Gesendet: Mittwoch, 19. September 2018 23:47 > An: PHP Internals List > Betreff: Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2 > > On 19/09/2018 22:30, Marco Pivetta wrote: > > > > At least the app

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Marco Pivetta
On Wed, Sep 19, 2018 at 11:46 PM Rowan Collins wrote: > On 19/09/2018 22:30, Marco Pivetta wrote: > > > > At least the approach without nullable properties will lead to a > > Throwable when a read is attempted on an uninitialized object, which > > is still better than nullability checks all over

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Rowan Collins
On 19/09/2018 22:30, Marco Pivetta wrote: At least the approach without nullable properties will lead to a Throwable when a read is attempted on an uninitialized object, which is still better than nullability checks all over the place. Is it? Doesn't it just mean writing this: try {    

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Marco Pivetta
On Wed, Sep 19, 2018 at 11:17 PM Rowan Collins wrote: > On 19/09/2018 21:04, Levi Morrison wrote: > > I think this code should be allowed: > > > > class User { > > public int $id; > > public string $preferred_name; > > public string $username; > > } > > Why?

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Rowan Collins
On 19/09/2018 21:04, Levi Morrison wrote: I think this code should be allowed: class User { public int $id; public string $preferred_name; public string $username; } Why? What contract is being enforced by that class that is not enforced by this class?

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Levi Morrison
On Wed, Sep 19, 2018 at 1:06 PM Rasmus Schultz wrote: > > On Wed, Sep 19, 2018 at 7:43 PM Rowan Collins wrote: > > > I agree that this is a hard problem, but I don't agree that this decision > > is being made "for now". If we allow "non-nullable but uninitialized" > > properties now, it will be

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Rasmus Schultz
On Wed, Sep 19, 2018 at 7:43 PM Rowan Collins wrote: > I agree that this is a hard problem, but I don't agree that this decision > is being made "for now". If we allow "non-nullable but uninitialized" > properties now, it will be extremely hard to change their behaviour in > future. I'm with

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Rowan Collins
On Wed, 19 Sep 2018 at 16:57, Levi Morrison wrote: > I posit that this code: > > class Foo { > public Foo $foo; > } > > Is superior to this code: > > class Foo { > public ?Foo $foo = null; > } > > If after "initialization" that `$foo` is guaranteed to always

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Levi Morrison
On Wed, Sep 19, 2018 at 6:38 AM Rowan Collins wrote: > > On Tue, 11 Sep 2018 at 08:05, Bob Weinand wrote: > > > Hey, > > > > As announced, we are starting the vote on typed properties today. > > > > The voting period is two weeks, until sometime in the evening on Tuesday > > 25-09-2018. > > > >

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Rowan Collins
On Tue, 11 Sep 2018 at 08:05, Bob Weinand wrote: > Hey, > > As announced, we are starting the vote on typed properties today. > > The voting period is two weeks, until sometime in the evening on Tuesday > 25-09-2018. > > Please find the RFC at https://wiki.php.net/rfc/typed_properties_v2. >

[PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-11 Thread Bob Weinand
Hey, As announced, we are starting the vote on typed properties today. The voting period is two weeks, until sometime in the evening on Tuesday 25-09-2018. Please find the RFC at https://wiki.php.net/rfc/typed_properties_v2. Bob and Nikita -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-20 Thread Rowan Collins
On 20/11/2016 16:24, Rasmus Schultz wrote: A consistent, complete type-system is not a "trend". [...] Anyways, glad to hear Bob Weinland has been working on typed references and the RFC is not dead :-) Just to reiterate, I don't agree that these two sentiments go together: a consistent type

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-20 Thread Rasmus Schultz
> if you've hired developers that care more about trends than your application then you've hired the wrong developers. A consistent, complete type-system is not a "trend". In my experience, good developers notice things like inconsistency - and they generally do not like it. I am personally

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-19 Thread Rowan Collins
On 19/11/2016 14:04, Rasmus Schultz wrote: lack of features and consistency [...] where these features were engineered into the language from the design stage, rather than being added on a bit at a time. I think the consistency and "engineered in" parts of this are more important than people

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-19 Thread Stephen Reay
Thanks for your work on this Bob, it is *very* appreciated! > On 19 Nov 2016, at 21:51, Bob Weinand wrote: > > Hey there, > > I’ve actually been working on an implementation covering also typed > references, so that it’s possible to create references to a typed property,

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-19 Thread Bob Weinand
Hey there, I’ve actually been working on an implementation covering also typed references, so that it’s possible to create references to a typed property, which had been a major concern back then. See also:

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-19 Thread Daniel Morris
If every language is the same then what's the point of different languages? People use Scala and PHP for different things, if your developers are considering walking for that reason then they should evaluate whether they want to build things or whether they want to be trendy. Good (heck, great)

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-11-19 Thread Rasmus Schultz
Heh, so, this week, a coworker of mine started using PHP 7, and he calls me over, and he's like, "I don't get it, I had heard PHP 7 was supposed to have type-hints now - it worked for return-types, but what am I doing wrong, I can't seem to get this to work for properties?" He actually had

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-23 Thread Pascal MARTIN, AFUP
Le 10/06/2016 12:38, Joe Watkins a écrit : The vote for typed properties has been restarted. Hi, We, at AFUP, often tend to be on the "more static / strict types" side of things, and it remains this way for this RFC -- which means we would be +1 for typed properties. A few noted this

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Lester Caine
On 22/06/16 22:21, Rowan Collins wrote: > But we haven't ever decided what that road is, so how can we know what > the next step is? What if we realise that the way we've implemented > typed properties is completely at odds with the way we want to implement > typed locals? Why should a 'var'

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Rowan Collins
On 22/06/2016 20:06, Rasmus Schultz wrote: With Dart, you have a choice - you can actually toggle whether or no type-checks should be performed at run-time. It's probably the best of those two references, if you're looking for inspiration for PHP. Ooh, that sounds interesting, I'll have to

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Rasmus Schultz
On Wed, Jun 22, 2016 at 7:44 PM, Rowan Collins wrote: > > Out of curiosity, do these languages perform the type analysis at > compilation, or at run-time? I'm trying to collate some examples of how > other languages have approached the problem. In Typescript, the

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Rowan Collins
On 22/06/2016 16:58, Rasmus Schultz wrote: On Wed, Jun 22, 2016 at 11:59 AM, Lester Caine wrote: Having worked in other gradually-typed languages like Dart and Typescript Out of curiosity, do these languages perform the type analysis at compilation, or at run-time? I'm

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Michał Brzuchalski
2016-06-22 18:49 GMT+02:00 Larry Garfield : > On 06/22/2016 10:58 AM, Rasmus Schultz wrote: > >> The learning curve for new users isn't increased by the introduction >> of property type-hints, it's *decreased* >> > > I want to put that line on a plaque. It applies for a

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Larry Garfield
On 06/22/2016 10:58 AM, Rasmus Schultz wrote: The learning curve for new users isn't increased by the introduction of property type-hints, it's *decreased* I want to put that line on a plaque. It applies for a lot of features being offered for PHP: They do actually make the language easier,

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Christoph Becker
On 22.06.2016 at 17:58, Rasmus Schultz wrote: > Give them a consistent language and new developers will rise to the > occasion - I'm sure of it. You're just not giving them a chance. > Type-hinted properties are a step towards fixing that situation - they > don't add, they *remove* complexity and

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Rasmus Schultz
On Wed, Jun 22, 2016 at 11:59 AM, Lester Caine wrote: > > If all these other languages are so much better why is the usage of PHP > *SO* much greater than any of them with no sign of any of them gaining > traction? I'm sorry, but that kind of rhetoric is really unproductive.

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Rowan Collins
On 22/06/2016 10:37, Michał Brzuchalski wrote: I may don't have voting privileges but as an 10yr PHP development practitioner I can't believe that such big and awesome feature like Typed Properties minimally can't have enought votes to be a part of PHP language (26/(26+16) = 62% and that's not

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Michał Brzuchalski
Hi, According to my knowledge this path doesn't implement only string and int types but whole of type hinting. So your example usage of string and int maybe is unneded 'additional' check, but in other cases where you expect objects which implements specific inteface or class it's huge advantage

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Marco Pivetta
Top-posting due to mobile conn. I voted no due to flaws introduced in the language by the current RFC. The performance impact is irrelevant. On Jun 22, 2016 11:38, "Michał Brzuchalski" wrote: > Hi, > > I may don't have voting privileges but as an 10yr PHP development >

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Lester Caine
On 22/06/16 11:25, Michał Brzuchalski wrote: > Nobody will pursuade me not that type safety is nothing significant in > programming language. 'type safety' is perhaps the problem here. In a compiled language you are only ever passing a binary value for which the 'type' is a critical element, but

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Michał Brzuchalski
Hi, I agree with you, but this patch does not result in any increase in complexity - there still will be a way to declare non typed properties and most of those developers wouldn't even fell any impact complexity on development stage. My goal is not to judge which language is better but to

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Lester Caine
On 22/06/16 10:37, Michał Brzuchalski wrote: > Without it, PHP will newer be aqualed such as Java, C# even Hack language - > there still will continue to be a big gap, due to the lack of type hinting. > Sure you could say start to code in Hack it has type safier system, it has > generics,

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-22 Thread Michał Brzuchalski
Hi, I may don't have voting privileges but as an 10yr PHP development practitioner I can't believe that such big and awesome feature like Typed Properties minimally can't have enought votes to be a part of PHP language (26/(26+16) = 62% and that's not enoght to 2/3+1vote). There are plenty of

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-13 Thread Joe Watkins
Morning, > This wouldn't affect the performance of untyped properties at all. There are extra instructions in that code. When the code you have is only 5 instructions, adding 1 more instruction makes a 20% increase in instructions ... That is what we are looking at in these micro benchmarks;

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-12 Thread Lester Caine
On 12/06/16 14:03, Rasmus Schultz wrote: > If I had to implement type-checked properties in plain PHP, I would do > something like this... > > /** > * @property int $price > */ > class Product > { > private $_price; > > public function __set($name, $value) { > if ($name ===

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-12 Thread Rasmus Schultz
Pretend I know (basically) nothing about how PHP was implemented, because I don't ;-) But I don't understand why regular property updates should be affected by this at all? If I had to implement type-checked properties in plain PHP, I would do something like this... /** * @property int $price

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-11 Thread Thomas Bley
y. > > > From: Joe Watkins <pthre...@pthreads.org> > Sent: Friday, June 10, 2016 1:38:04 PM > To: PHP internals; Phil Sturgeon > Subject: [PHP-DEV] [RFC][Vote] Typed Properties > > Afternoon internals, > >The vote for typed propert

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Yasuo Ohgaki
Hi Dmitry, On Fri, Jun 10, 2016 at 9:37 PM, Dmitry Stogov wrote: > I hardly worked on implementation of this patch for a week, but I still don't > like it. > > It makes 15% slowdown on each property update in existing PHP code (without > types), and I don't see a way to

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Lester Caine
On 10/06/16 22:05, Larry Garfield wrote: > > https://seld.be/notes/php-versions-stats-2016-1-edition > > The code being written is veering heavily toward newer versions, and > anecdotally most of the code I see is classed with typed parameters. > (Yes, anecdotes are not data, and I acknowledged

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Larry Garfield
On 06/10/2016 03:01 PM, Lester Caine wrote: On 10/06/16 20:51, Larry Garfield wrote: On 06/10/2016 02:14 PM, Lester Caine wrote: On 10/06/16 17:57, Rowan Collins wrote: For the record, I'm not entirely sure which way I want the language to go, but I think it's a decision that needs to be

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Lester Caine
On 10/06/16 20:51, Larry Garfield wrote: > On 06/10/2016 02:14 PM, Lester Caine wrote: >> On 10/06/16 17:57, Rowan Collins wrote: >>> For the record, I'm not entirely sure which way I want the language to >>> go, but I think it's a decision that needs to be made, and soon. >> Seconded ... even

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Larry Garfield
On 06/10/2016 02:14 PM, Lester Caine wrote: On 10/06/16 17:57, Rowan Collins wrote: For the record, I'm not entirely sure which way I want the language to go, but I think it's a decision that needs to be made, and soon. Seconded ... even something like strict mode should be 'removable' to

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Lester Caine
On 10/06/16 17:57, Rowan Collins wrote: > > For the record, I'm not entirely sure which way I want the language to > go, but I think it's a decision that needs to be made, and soon. Seconded ... even something like strict mode should be 'removable' to provide a smaller faster 'classic' PHP even

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Larry Garfield
On 06/10/2016 11:57 AM, Rowan Collins wrote: On 10/06/2016 17:16, Larry Garfield wrote: That seems like a worthwhile trade-off for a <1% performance difference in a real-world application. The problem is that the performance hit is felt even for code that doesn't "opt in" to this feature.

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Rowan Collins
On 10/06/2016 17:16, Larry Garfield wrote: That seems like a worthwhile trade-off for a <1% performance difference in a real-world application. The problem is that the performance hit is felt even for code that doesn't "opt in" to this feature. For an application that makes no use of the

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Larry Garfield
On 06/10/2016 10:01 AM, Dmitry Stogov wrote: To clarify though, didn't Wordpress and Mediawiki see only a 0.1% slowdown? In my opinion that is definitely a tolerable performance hit for such a feature. I don't see any big value in this feature. Most framework access their properties through

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Dmitry Stogov
anks. Dmitry. From: Joe Watkins <pthre...@pthreads.org> Sent: Friday, June 10, 2016 1:38:04 PM To: PHP internals; Phil Sturgeon Subject: [PHP-DEV] [RFC][Vote] Typed Properties Afternoon internals, The vote for typed properties has been restarted. Pleas

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Dmitry Stogov
__ From: Joe Watkins <pthre...@pthreads.org><mailto:pthre...@pthreads.org> Sent: Friday, June 10, 2016 1:38:04 PM To: PHP internals; Phil Sturgeon Subject: [PHP-DEV] [RFC][Vote] Typed Properties Afternoon internals, The vote for typed properties has been restarted. Please take pa

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Dmitry Stogov
<pthre...@pthreads.org> Sent: Friday, June 10, 2016 1:38:04 PM To: PHP internals; Phil Sturgeon Subject: [PHP-DEV] [RFC][Vote] Typed Properties Afternoon internals, The vote for typed properties has been restarted. Please take part: https://wiki.php.net/rfc/typed-properties Cheers Joe To cl

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Joe Watkins
Woops, no it isn't ... the property is private ... Cheers Joe On Fri, Jun 10, 2016 at 3:42 PM, Joe Watkins wrote: > That's a bug ... that should throw ... > > Cheers > Joe > > On Fri, Jun 10, 2016 at 3:12 PM, Bob Weinand wrote: > >> >> Am 10.06.2016

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Joe Watkins
That's a bug ... that should throw ... Cheers Joe On Fri, Jun 10, 2016 at 3:12 PM, Bob Weinand wrote: > > Am 10.06.2016 um 16:00 schrieb Niklas Keller : > > 2016-06-10 15:50 GMT+02:00 Bob Weinand : > >> >> Am 10.6.2016 um 15:34

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Bob Weinand
(and not changed with the latest >> version of the patch). >> >> >> -1. >> >> >> Thanks. Dmitry. >> >> ____________ >> From: Joe Watkins <pthre...@pthreads.org> >> Sent: Friday, June 10, 2016 1:38:04 P

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Levi Morrison
__ > From: Joe Watkins <pthre...@pthreads.org> > Sent: Friday, June 10, 2016 1:38:04 PM > To: PHP internals; Phil Sturgeon > Subject: [PHP-DEV] [RFC][Vote] Typed Properties > > Afternoon internals, > > The vote for typed properties has been restarte

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Bob Weinand
> Am 10.06.2016 um 16:16 schrieb Niklas Keller : > > > 2016-06-10 16:12 GMT+02:00 Bob Weinand >: > In this case a definite -1 on the RFC from me. I don't want "surprises" > regarding the type if a property is declared to

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Niklas Keller
2016-06-10 16:12 GMT+02:00 Bob Weinand : > In this case a definite -1 on the RFC from me. I don't want "surprises" > regarding the type if a property is declared to return a certain type. > Where's the surprise?

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Bob Weinand
> Am 10.06.2016 um 16:00 schrieb Niklas Keller : > > 2016-06-10 15:50 GMT+02:00 Bob Weinand >: > >> Am 10.6.2016 um 15:34 schrieb Niklas Keller > >: >> >>> >>> Top-posting, since

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Niklas Keller
2016-06-10 15:50 GMT+02:00 Bob Weinand : > > Am 10.6.2016 um 15:34 schrieb Niklas Keller : > > > Top-posting, since I'm taking off now. > > From outside the class, properties are not visible at all, so their types > are un-important from outer scopes. > >

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Bob Weinand
> Am 10.6.2016 um 15:34 schrieb Niklas Keller : > >> >> Top-posting, since I'm taking off now. >> >> From outside the class, properties are not visible at all, so their types >> are un-important from outer scopes. >> >> echo $foo->bar; is not the same in instance method body

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Niklas Keller
> > Top-posting, since I'm taking off now. > > From outside the class, properties are not visible at all, so their types > are un-important from outer scopes. > > echo $foo->bar; is not the same in instance method body or outside of the > class. > >From outside it works just fine and doesn't

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Marco Pivetta
Top-posting, since I'm taking off now. >From outside the class, properties are not visible at all, so their types are un-important from outer scopes. echo $foo->bar; is not the same in instance method body or outside of the class. On Jun 10, 2016 2:55 PM, "Niklas Keller"

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Niklas Keller
2016-06-10 14:39 GMT+02:00 Marco Pivetta : > As already mentioned on twitter, I voted "no" on this RFC as it currently > stands. I might reconsider if following points are addressed: > > 1. __get semantics are not changed: let __get behave like it usually does, > and let the

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Marco Pivetta
As already mentioned on twitter, I voted "no" on this RFC as it currently stands. I might reconsider if following points are addressed: 1. __get semantics are not changed: let __get behave like it usually does, and let the user define a type hint on __get, should any be applicable. Basically:

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Dmitry Stogov
results are included into RFC (and not changed with the latest version of the patch). -1. Thanks. Dmitry. From: Joe Watkins <pthre...@pthreads.org> Sent: Friday, June 10, 2016 1:38:04 PM To: PHP internals; Phil Sturgeon Subject: [PHP-DEV] [RFC][Vote]

[PHP-DEV] [RFC][Vote] Typed Properties

2016-06-10 Thread Joe Watkins
Afternoon internals, The vote for typed properties has been restarted. Please take part: https://wiki.php.net/rfc/typed-properties Cheers Joe

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-29 Thread Lester Caine
On 28/05/16 09:06, Lester Caine wrote: > class Person { > protected var $death; // var is intentional - my flag for a holder > $death->__type( DateTime, not_null = false ); > > To which one can add > $death->__limit( $birth, '120years' ); > Where $birth now has to be the same type and

  1   2   3   >