I don't think you can have a "write only" attribute. If you can write, you can read, you just read the value of that property. If you don't define a "get" hook, you get the original. Defining the get hook just allows you to do some cool stuff behind the scenes like in the full name example. In that example, if you didn't have a get, you would just get back an empty string because last name is never truly set.
I think Property Hooks is a mistake. It adds not so much, yet it allows to create completely unhinged mess, if used wrong. Don't like this trend of "lets put all the new stuff for the sake of new stuff". Language consistency >> new features.
I agree mostly. They look over-complicated and easy to confuse new devs. It's like putting class method behavior in a var. I've always hated get/set since Java, though I understand its purpose. Hopefully people won't overuse this anyway, as it seems best for high-level or very popular applications that need tight security with a lot of different devs coming in and out.
You missed three other major features: 1) Interface properties (Part of hooks, but useful on their own.) 2) Asymmetric visibility 3) Lazy objects Those are at least as cool as rounding modes. 🙂 (Which have also now become enums, I believe.)
@@Phparch tbh, I just need it for reflection. I want to build graphqly types based on the underlying php type. And an array is an array of anything. I know I could use doc comments for that, or maybe I'll use property annotation. My longterm goal is to not write PHP though.
Class method calls without parentheses just ambiguates them with object vars. Yay. I suppose code editors will use syntax coloring to differentiate... but it still makes PHP look sloppier, and it's already notorious for allowing too much sloppiness.
If you don't like it, stay away. I rarely have issues with coercion because I know when there will be ambiguity. Many people don't see at this level. Maybe types must be used for thoughtless or inconsiderate coders, but I'd rather just not have thoughtless or inconsiderate coders.
My left ear enjoyed this.
Sorry about that we'll have it fix for future videos.
-sk
@@Phparch I thought my headphone had a failure
🤣😂🤣😂
Only my right headphone works so sucks for me! lol
😀😀😀
Please fix your sound. There's no right audio on this video
To be fair, it’s php
Sorry about the audio, we figured it out and the future videos won't have that problem.
-sk
Agreed. I find it unwatchable like this.
the audio is mono, is only on the left side
they should've add a headphone ads. Stonks
What a great summary, good job!
Thank you!
-sk
Thanks for the video!
You're welcome and thank you for the comment!
-sk
You're welcome and thanks for the comment!
-sk
I have to double check ear bud whether it is working on sterio 😅
Sorry about that we figured out the problem and it will be corrected in future videos
-sk
cool audio 😎
Sorry about that. We've corrected our process so it doesn't happen again.
-sk
nice share, love it
Thanks!
-sk
Getting closer and closer to C# 😂
another benefit of property hooks is that it finally allows you to enforce properties in an interface
Oh yeah that's great too! We'll have to to make sure we mention that in the property hooks video we make
-sk
Reflection of light in glasses totally distracting as you move your head around the lights appear and disappear. Just an observation.
Sorry about that we'll take this into consideration
-sk
I don't think you can have a "write only" attribute. If you can write, you can read, you just read the value of that property. If you don't define a "get" hook, you get the original. Defining the get hook just allows you to do some cool stuff behind the scenes like in the full name example.
In that example, if you didn't have a get, you would just get back an empty string because last name is never truly set.
You can have a write-only virtual property. If the set hook references itself to save a value, then yes, "get" would work implicitly.
to fix your audio issues if you ever have this export the video in mono
Sorry about that. I'm honestly not sure how the export setting changes but it's been fixed.
-sk
watching from Kerala, India, Bincy Elizabeth Mathew.
👍
-sk
I wish some PHP version in the future will bring us native WebSockets..
That would be nice.
-sk
.shtml? Or .xhtml?
I think Property Hooks is a mistake. It adds not so much, yet it allows to create completely unhinged mess, if used wrong.
Don't like this trend of "lets put all the new stuff for the sake of new stuff". Language consistency >> new features.
I agree mostly. They look over-complicated and easy to confuse new devs. It's like putting class method behavior in a var. I've always hated get/set since Java, though I understand its purpose. Hopefully people won't overuse this anyway, as it seems best for high-level or very popular applications that need tight security with a lot of different devs coming in and out.
Oy! What happened with dual channel voice? Can only hear you on the left ear O_O please fix for next time since your videos are actually awesome
Thank you so much!
Sorry about the audio, we figured it out and the future videos won't have that problem.
-sk
You missed three other major features:
1) Interface properties (Part of hooks, but useful on their own.)
2) Asymmetric visibility
3) Lazy objects
Those are at least as cool as rounding modes. 🙂 (Which have also now become enums, I believe.)
Larry, thanks for the feedback. We'll have to run our list past you next year. :-) I think we'll have to make videos just about those.
-sk
Is it my headphone? I can't concentrate :D
Sorry about that we've solved the problem for future videos.
-sk
I thought my right earphone is dead!
Sorry about that we've already taken steps to prevent it on future videos.
-sk
I just want chained lambdas
That would be awesome!
-sk
When will we get generics and Lists... never :( Php development goes so slow, compared to other languages.
There actually some performance based reasons we'll never get this. I'm bummed it won't happen as well...
-sk
@@Phparch tbh, I just need it for reflection. I want to build graphqly types based on the underlying php type. And an array is an array of anything. I know I could use doc comments for that, or maybe I'll use property annotation. My longterm goal is to not write PHP though.
Class method calls without parentheses just ambiguates them with object vars. Yay. I suppose code editors will use syntax coloring to differentiate... but it still makes PHP look sloppier, and it's already notorious for allowing too much sloppiness.
No modern type system in 2024 lol. Enjoy your 8.4!
If you don't like it, stay away. I rarely have issues with coercion because I know when there will be ambiguity. Many people don't see at this level. Maybe types must be used for thoughtless or inconsiderate coders, but I'd rather just not have thoughtless or inconsiderate coders.
Thanks for the comment!
-sk
property hooks ---> rip off from C#, but OK, good stuff should be incorporated