PHP more and more looks like C#, I think it's a good thing.
28 күн бұрын
PHP#
@imqqmi28 күн бұрын
Very sharp!
@stjepanmajdak739628 күн бұрын
And C# is getting some unique PHP features with almost every new version
23 күн бұрын
@@stjepanmajdak7396 could you elaborate? That's interesting. I'm just curious, I've been using C# only little, two digits years ago.
@erickdeazevedolima1763Ай бұрын
I've been waiting for the asymetric visibility + property hooks combo for a decade (I used them in C# all the time before diving for real in PHP). I'm really excited for it.
@fabio.antunes29 күн бұрын
Hello. Just found your channel thanks to this video. Thanks for the summary and straight to the point examples. Awesome.
@nobodyspecial946Ай бұрын
I rewinded more than 5 times to moment 3:36 :D They way you said it and you face expression make me laugh so much :D "It took them more than decade to add, but HEY! IT'S HERE"
@phpannotatedАй бұрын
😂
@zonegamma819729 күн бұрын
cool to see the language evolving a lot these last years
@qqleqАй бұрын
Love it all! I used property get/set/let all the time when I was programming in VBA I think even thirty years ago! Finally I can do something similar, but better, in PHP. I think I will use almost all of the updates immediately, I have been needing them all for quite some time.
@pierreprachtАй бұрын
30 years later... Only in PHP !
@GuzikPL4Ай бұрын
Some time a go Aaron Francis did a video about what changed in PHP since 2012 and i absolutely love these kind of videos. I would love to see more tricks and cool features i can use.
@phpannotatedАй бұрын
Ah yes, I remember that video. Aaron's great! In my defence though, I was the first one to do such an evolution video (and Aaron made a better version inspired by mine :p ) kzbin.info/www/bejne/rmrFhIila7l6nbs
@taghwomillionaireo.554316 күн бұрын
Didn’t really understand the asymmetric visibility RFC, thanks for the explanation
@lostcarparkАй бұрын
Very excited about property hooks, though asymmetric visibility means most of the time they won't even be needed.
@phpannotatedАй бұрын
Absolutely true! Gonna be HUGE
@3fcf91cb4e7 күн бұрын
Would love to see your view on Magento's approach to backend, or maybe an interview with someone experienced with it - there's a lot of interesting stuff to talk about. I've been working with it for years and there's so many awful implementations of this platform that maybe a video on the standards and principles it uses could help some developers realize how much stuff they do wrong. And not going to lie - a video/podcast that would summarize some of the basic PHP principles and guidelines (not even diving into detail) would be a blessing for the juniors I work with, not sure if you have one already
@NeverCodeAlone22 күн бұрын
Very good video. Thanks a lot.
@xelframeworkАй бұрын
properties hook are very interesting feature so far on php 8.4
@crossbow25828 күн бұрын
PHP is now similar to C#
@Pekz00r29 күн бұрын
Asymetric visibility is a game changer! I tend to use public properties more often than I should because it is so annoying to create and call getters for every property. I'm really looking forward to never write a simple property getter without any logic again. For the times you need some basic logic property hooks are also great!
@coder236Ай бұрын
When they eventually bring out 9 I'd love them to add a decent concurrency model
@phpannotatedАй бұрын
Oooh yeah that would be nice! I remember some people were looking at lib-uv compatibility around the 8.0 era for async/await support, but I don't think anything came from it
@coder236Ай бұрын
@@phpannotated if they could add it i think php would boom again. i love php but have been thinking of handing certain tasks over to a node or GoLang server for heavy lifting. anyway, keep up the awesome content ✌
@lostcarparkАй бұрын
Fibres gets close, especially with revolt, and I think could be developed into full concurency. What I don't like about async/await in JS is the way it is used for many things that 99% of the time you want to use completely synchronously, but you have to include asynchronous boilerplate for the rare asynchronous use cases. I hope we can come up with a syntax that enables better concurency without imposing extra burden on simple use cases that just want to call an action and wait for it to finish.
@zebraforceone29 күн бұрын
Check out fibres
@SXsoft9929 күн бұрын
My DTO classes will become much cleaner :))
@llBestBoyllАй бұрын
That was vert informative thx ❤
@mr_raspberry_jamАй бұрын
Where can I get one of them php elephants you have behind you?
@GopherOnlineАй бұрын
echo great video
@ramizazhar8891Ай бұрын
forgot the ""
@GopherOnline29 күн бұрын
@ramizazhar8891 😁
@abrahamolaobaju178125 күн бұрын
looking good
@pranansubba958720 күн бұрын
Idk why but getter and setter sounds quite logical if working in framework.
@Tigerman55Ай бұрын
I think property hooks are more applicable to legacy projects (maybe), than it is to new code. You can use readonly classes and then you don't need any getters or setters anyways. Passing objects into a service with named constructors prevents the need for logic in either getters or setters. So it is moot point for most modern cases. Readonly with only private mutation is useful in some cases, I think.
@SXsoft9929 күн бұрын
Not necessarily, you might want to set certain values in the constructor based on another value. Currently you either do it when you instantiate the class, or in the constructor but you move the property from being defined in your constructor method to being as a class property. The read only private thing is more than you can finally use the interfaces to define this functionality while currently you can only have props public.
@badasukerubinАй бұрын
I can't wait for property hooks
@prometheus600129 күн бұрын
What IDE is that and if its IDEA, what template or how did you get to that look and feel?
@phpannotated29 күн бұрын
It's PhpStorm with the new layout (enabled by default in newest installs), and my custom color scheme: github.com/brendt/phpstorm-light-lite-theme
@31redorange0829 күн бұрын
Are there any use cases for PHP outside of extending CMS?
@SXsoft9929 күн бұрын
- server-side CLI(Terminal) scripting, - automatic queue system in conjunction with linux supervisorCTL - desktop apps(be it a niche) - Web APIs, you can respond with Json, xml, file stream, etc. You are not limited to HTML
@31redorange0829 күн бұрын
@SXsoft99 I know that these things are possible, but why would you choose PHP over other languages (other than only knowing PHP)?
@merlin-1d29 күн бұрын
Yes, if you're a developer and you're honest with yourself, you know exactly why😉
@LatenightDev24 күн бұрын
@@31redorange08 Who says that ? What makes you think those who use PHP don't use other languages?
@31redorange0824 күн бұрын
@@LatenightDev That's not what I was saying.
@rustix3Ай бұрын
I see a lot of things available in other languages are adopted in PHP, which is good. But when will set and map/dictionary data types be available outside of the box in PHP?
@zebraforceone29 күн бұрын
Associative arrays are a map
@SXsoft9929 күн бұрын
do you work only with auto indexed arrays? have you never done: $arr=[]; $arr['name']='test'; $arr['list']=['test_key' => 'text_val']; ?
@honk_tmАй бұрын
yes, I hate property hooks, other things are absolutely welcomed
@phpannotatedАй бұрын
Fair enough!
@aurelian3401Ай бұрын
print 'ok'; // amazing
@marius-v4sАй бұрын
property hooks in interfaces is fucking huuuuge, they're cooking good
@CottonInDerTubeАй бұрын
3:00 That feels wrong. Doesnt this require a __construct to return $this (which actually returns void only)?
@krycekaiolfiАй бұрын
The __construct is, returns void. But the 'new' keyword returns an object.
@farhanasultana921329 күн бұрын
PHP needs front end async features instead on relying on js, which will make it a full stack language.
@LatenightDev24 күн бұрын
php doesn’t need to be asynchronous. as every request uses its own php thread. need to scale php? add more workers in your webserver. need to scale nodejs: run multiple instances behind a load balancer and carefully manage listening ports. php makes life easy, when low latency isn’t a strict requirement.
@asagiai4965Ай бұрын
Hmm the ability to make setter private. Where have I seen that? Ah yes VB Maybe there's also in C# Anyway I think these are ok features.
@robwatson826Ай бұрын
All I want is a function autoloader then I'll be totally happy with PHP
@SXsoft9929 күн бұрын
in your composer.json { ..., "autoload": { "files": [ "app/Helpers/helpers.php", ], }, ... }
@svobodnjkАй бұрын
And still no generics... 😢
@SXsoft9929 күн бұрын
you kinda have them as comments but not enforced :)) /** @var array $variable */ It helps with the IDE a lot you can also have complex ones /** @var array{name:string, tags:array{name:string}} */ works with @prop/@property-read/@method
@David-ng9qh29 күн бұрын
I really dislike the new deprecation of the implicitly marking a function parameter as nullable if it's default value is null. This was a great marker that a user should not pass in null, but that the implementation would resolve to a default (non-const) value at runtime if nothing was provided. I do not understand why this is deprecation worthy, I get that it is a weird thing, but it is also a great design pattern and is quite literally used everywhere. I use it everywhere, and laravel/framework does too. I understand just making the type nullable does not affect the way PHP handles this scenario at all, but it's about the semantics the consumer of a library will deal with, which will now be worse. Example ```php function a(int $b = null) { $b ??= get_default_value_for_b(); // ... } a(); // user knows not to pass in null a(1); // good
@phpannotated29 күн бұрын
Interesting! I personally never considered that use case 🤔
@SXsoft9929 күн бұрын
they want to do it because a lot of devs abuse it and it leads to a lot of errors
@susanthawarnapuraАй бұрын
forget PHP 8.4 we need generic support and strict types
@holonaut29 күн бұрын
Generics when?
@jsomhorst29 күн бұрын
Never. Search and see it is really hard to implement in a language like this
@holonaut29 күн бұрын
@jsomhorst actually generics already work with annotations and phpstan. PHP maintainers are just not adding it to the language out of spite at this point
@jsomhorst29 күн бұрын
@holonaut yes I know. That is the IDE doing it's thing. PHP doesn't care.
@nikolayivanov321Ай бұрын
Not sure how I feel about being able to use property hooks for promoted properties, I can see this getting ugly real fast. Other than that, it seems like a fantastic release.
@CottonInDerTubeАй бұрын
0:50 omg! Im not bi***ing, i just dont understand why this would make things better :D But hey - we can still use getters and setters =) _Which i will 100% do until i die._
@SomeniatkoАй бұрын
One use case is that you can add more logic to an already existing without having to convert all its users to use a getter/setter, keeping backwards compatibility
@turi.commodoreАй бұрын
i'm thinking of all the useless getters in my aggregates that will FINALLY be dropped thanks to private(set).... hell yeah
@a-yon_n28 күн бұрын
Yet still doesn't have variable type notations and generics. It's frustrating to see a language evolve so much but actually change so little. I will never use PHP again until it has these two features.
@MLHAFAKOT29 күн бұрын
Stop using bright mode
@phpannotated29 күн бұрын
kzbin.info/www/bejne/o6aTeX1mlNCjqMU
@MelroyvandenBergАй бұрын
HTML5 support took only a decade to add hhaha. Classic
@Rhmtsky24 күн бұрын
Meh, i'll stick to 8.2 til php 9 released then.
@phpannotated24 күн бұрын
Ok 👌
@danser_theplayer01Ай бұрын
The language name sounds like some old vacuum cleaner coughed up dust. pghhp💨
@Alex-pg1gt28 күн бұрын
Meh
@rickmyers7627Ай бұрын
Why not use magic methods for getting rid of getters and setters... seriously, this reason is why I left programming Java... PHP's magic methods, and autoloaders, are amazing and make coding "conventions over configuration" a breeze.
@krycekaiolfiАй бұрын
Magic methods doesn't play nice with static analysis, intellisense, etc.