« first day (4915 days earlier)      last day (259 days later) » 

11:06
@LeviMorrison Whats the issue with those? And Hyrums law pretty much says no. But it requires more learning it seems peeking into some of the more recent RFCs.
 
5 hours later…
16:25
@hakre These methods basically require the array to be duplicated by the ArrayIterator. It's terrible from a performance perspective to have to clone an array just to iterate over it. Also, most of these methods don't really make sense on an iterator. In PHP, we don't sort iterators... it's not a thing. Sort the array, not the iterator.
^ This is only half-true. The real issue is ArrayIterator and ArrayObject share a lot of internals, and ArrayObject requires the duplication because of these methods. ArrayIterator gets them by proxy.
Nikita gave it a look one time, and didn't commit it so... that's pretty strong signal ^_^
I was quite busy at the time. I wish I had captured everything from him as better justification for writing an RFC to move forward about it.
16:37
@IluTov I haven't yet. Can you send me the branch again and I'll bookmark it?
 
2 hours later…
19:06
Not to bikeshed, but if we ever have an official static analyser or spec, you're likely going to wish for ! to be available for a much more common expression. With ? being the nullsafe, ! I would think would be the assert-none-nully (although i'm basing that on TS)
>We must reserve grammar to be more like TypeScript
LOL
When talking about language-level static analysis, referencing one of the most powerful typing engines that a lot of PHP developers will have first-hand familiarity with is a pretty good starting point :-)
@MarkR I think nobody really wants ! there. It's mostly a placeholder.
Why would PHP even need an assert-not-null operator?
@bwoebi I don't really mind the syntax. Can't think of something much better. Maybe someone on the list has an idea.
@QuolonelQuestions As Mark said, static analysis, or just hardening, given that PHP continuous on null in many operations.
*continues
19:15
How many repeat property calls would you have to go through before the performance hit was more substantial than the performance improvement from the CoW mechanism?
But PHP doesn't perform static analysis and it's not a pre-processor like TS. TS doesn't actually know if your assert-not-null test is even true, it's just a quick hack to cheat the preprocessor into ignoring a potential violation, which can still be violated at runtime anyway
Sorry, I missed a bit of context, I mean in the context of having to replay the property chain in write mode
@MarkR It depends on what you compare it to. This opens up new use-cases, rather than being a faster alternative. Essentially, it's a way to do readonly things without them being readonly
Instead of calling many wither methods, the object will be copied only when necessary and only once, even if you make multiple changes.
If that makes sense. The pr description tries to explain in more detail.
So with the wither bit, the objective is to avoid reallocation on every clone because wither methods typically only modify the one property?
@MarkR Right. But you also may just not know if an object is currently still references somewhere else and this copy it, even if it may be unnecessary.
19:31
I seem to remember this is the same problem that Nikita ran into with the scalar methods, or something like it.
19:41
@QuolonelQuestions I am collecting ideas about improved Date/Time APIs. I am not in favour of your single change therefore. It needs proper thinking out instead of sticky plasters: docs.google.com/document/d/…
I'm planning to flash that document out next week.
So, feel free to add ideas (to the bottom, please).
What is likely to be the final technical output from this document?
Presumably just extensions to the existing API?
Unless you were planning to completely throw away the existing API, I'm not sure why any (additional) improvement so proposed in this document should preclude the one I've put forward, unless you think they might be in conflict with some other changes?
The only thing I can see that would even come close is the getters/setters you're proposing, but even then, I see that as a welcome additional improvement that neither conflicts with, nor diminishes an improvement to setDate
Nevertheless, I respect your decision to postpone it until things are more ironed out
@MarkR Regarding references? It's similar, although not quite the same.
@IluTov CoW for mutating array methods if memory serves.
19:57
@MarkR Yes, I suppose it's quite similar.
The same syntax would indeed help with scalar methods.
For self-mutating methods, that is.
I was curious about replaying the ops for the property list because I think that's what was mentioned at the time, first pass determines if it's mutating, go back and replay them all in write mode. Although I am curious if replaying could back-fill opcode cache slots to tell them to use write instead next time, as a latch.
(Good job I'm not a cat...)
@MarkR Replaying is problematic because opcodes normally consume their operands. Replaying them will access released memory. Not releasing the operands means something else has to release them when the operands aren't replayed.
20:17
Ah, I see. In that case I'm out of ideas for the moment :P everything else I can think of right now involves $changing->something->like->thiis to a single opcode
I've come to the conclusion that a different syntax is not just a workaround but beneficial, because it indicates that this is more than just a normal method call.
E.g, $vec->sort!() will indicate that the data object itself is mutated, and the method isn't just returning a copy.
What would happen if it was called without?
@MarkR It errors in my patch.
Ah, I just saw you were passing it through the extended value of the opline
if (IS_CV & (IS_CV|IS_VAR)) { ... } Isn't that always truthy?
@MarkR are you looking at generated code?
20:31
Ah, yes I am
Thanks, I was looking at that a good few minutes going "eh?"

« first day (4915 days earlier)      last day (259 days later) »