Тёмный

Let's take a look at PHP 8.2 

PHP Annotated
Подписаться 16 тыс.
Просмотров 21 тыс.
50% 1

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 57   
@radui7468
@radui7468 Год назад
PHP is a great language and it is getting better and better with time. The only disadvantage that I see now is that the average salaries for a php developer are lower compared to any other language :(
@codingtostopprocrastinatio9748
Couldn't agree anymore. And if you are a Wordpress developer you are at the bottom.
@mweleme
@mweleme Год назад
Awesome channel. Could you do design patterns, maybe one per video, including new patterns? Thanks.
@phpannotated
@phpannotated Год назад
We've got a lot of different styles planned. Make sure to subscribe :)
@mweleme
@mweleme Год назад
@@phpannotated Great. The thing about them is that they really bring out PHP features like enums, readonly, etc. and its power and shortcoming while showing how to properly use them to solve various situations. Thanks.
@Vali615
@Vali615 Год назад
Keep making these videos, they great
@dotancohen
@dotancohen Год назад
Great video, thank you. Constructive criticism if you are interested: some words were difficult to understand. Here are the words that I could not understand: 0:10 Disjunctive normal form types, that ____. 2:29 Self, static, ____. (Actually, after playing it a few times and watching your code, I was able to figure out that the words were "or this".)
@alexodan
@alexodan Год назад
in case someone is wondering, 1) that is a mouthful 2) this like myself, you are probably not a native english speaker, it's something we can adjust to with practice ^^
@dotancohen
@dotancohen Год назад
@@alexodan Sure, and I appreciate your video! I just saw fit to maybe suggest that enunciation might be improved.
@NebojsaCinger
@NebojsaCinger Год назад
Good video, thanks for making it! Subscribed
@paranoiq
@paranoiq Год назад
hi Brent. thanks for great content, as usual ^_^ i have two remarks: - the countdown before video was insanely loud 🙉 - i noticed, that you like ligatures for things like -> or ===, but many people may not even know this IDE feature exists or they use an editor that does not do that, so i think code snippets should be presented in plain old ascii. ligatures may be confusing. no matter how cool it looks, it is not valid PHP code : ]
@jdlien81
@jdlien81 Год назад
@@phpannotated Personally I love the look of ligatures but I do agree that for mass-consumption, they could confuse some people. It's probably safer to leave them off in a tutorial or RU-vid video, especially when targeting less experienced users.
@sabuein
@sabuein Год назад
Thank you.
@llBestBoyll
@llBestBoyll Год назад
Hey man nice informative video 🔥
@NedumEze
@NedumEze Год назад
Dear Brent, I had something like this: $conn = new PDO ( DSN, #[\SensitiveParameter]USER, PW, OPTIONS); The arguments were defined in my Config.php file as constants. The connection failed! Please, what did I do wrong? Prepending the value with the attribute in the configuration file didn't work either! Only works when function or method parameters are hard-coded?
@Akimb321
@Akimb321 Год назад
I am honestly quite sad that arrow functions with more than one statement/expression did not pass the RFC vote. PHP 8.2 feels like minor upgrade, unfortunately. But it is better than nothing, so thanks to devs for the hard work
@siarheikaravai
@siarheikaravai Год назад
Technically it IS a minor update
@Nodsaibot
@Nodsaibot Год назад
had to turn volume to 12 so could listen to your whispers xD
@jdlien81
@jdlien81 Год назад
Sounds like it should be an easy upgrade, not too many breaking changes that will affect typical code.
@ignazioolivieri3795
@ignazioolivieri3795 Год назад
Is an example more reductive can you show this DNF (Disjunctive Normal Form ) with Interfaces A,B,C combining a class so (A&B) | C and obligatory types? Thank you ;)
@phpannotated
@phpannotated Год назад
Not sure I understand the question entirely, in your example, the input should implement either A _and_ B, _or_ C
@lostcarpark
@lostcarpark Год назад
Great information. Where is the video on dynamic properties?
@lostcarpark
@lostcarpark Год назад
@@phpannotated Cheers! Is casting an array to an object still okay? Because in that case all the properties are dynamic, aren't they?
@brentroose4775
@brentroose4775 Год назад
@@lostcarpark Indeed, but array casting to objects uses stdClass, which still allows dynamic properties :)
@lostcarpark
@lostcarpark Год назад
@@brentroose4775 Ah, that sounds sensible. I clearly need to learn about this, but it doesn't sound like something to panic about.
@hlizzle
@hlizzle Год назад
Additionally, i believe __get() and __set() will continue to work without issuing deprecation notices
@ziat1988
@ziat1988 Год назад
Could you please make a video about type hinting for modern PHP? Sometime I see some sources say like array. I can see it inspires by typescript but I can't see any source explain clearly for that. This is only for PHP > 8 I guess?
@ziat1988
@ziat1988 Год назад
@@phpannotated Thank you. Your series helps me answer a lot questions. Turn out it is Generics and came from doc block for static analyser. I searched Psalm and I can see that syntax. But I think it would be nicer with a solution more native like other language do. Maybe php 8.3 or 9 hopefully.
@lucazfc
@lucazfc Год назад
Disjunctive normal form FTW \o/!
@ce9916
@ce9916 Год назад
Hello. How do you select two not necessarily sequential instances like you’re doing at 3:27 ? In PhpStorm I can’t hit Alt-J to keep selecting sequentially, but I don’t know how to do it with a mouse.
@jcihrens
@jcihrens Год назад
In PhpStorm on Windows, place the first cursor, then press and hold the key and use the mouse to place additional cursors with a left-click. Release the key and you can write simultaneously in different places. Instead of just placing cursors, you can also mark different parts of your code while pressing , etc.
@ce9916
@ce9916 Год назад
@@jcihrens thank you very much, JC. I thought I had tried that without success, but I’ll give it another go. Thanks again 😊
@toblamabor7072
@toblamabor7072 Год назад
In 3:14, what is the "#[Something]" exactly? I never saw it before, is it something specific to your IDE? Or do you have a link to get more information about it? Thank you
@toblamabor7072
@toblamabor7072 Год назад
@@phpannotated thanks a lot!
@toblamabor7072
@toblamabor7072 Год назад
@@phpannotated can you do a video about it? I am reading the post but it seems a bit difficult
@toblamabor7072
@toblamabor7072 Год назад
@@phpannotated already done! thank you!!
@luisguerra0293
@luisguerra0293 Год назад
I need to know the theme you use. Can someone tell me?
@luisguerra0293
@luisguerra0293 Год назад
@@phpannotated Thanks a lot!
@CottonInDerTube
@CottonInDerTube Год назад
0:58 im into PHP all day for work and i love it. But why? Why "#[...]" ?? This is SO ugly. And # is comment. And [] is optional, which MAY fit, somehow. But why not just SensitiveString? I mean ... you could have a PHP default SensitiveString class. And if you really need to have your own string class you extend it. Nothing new. _Soon we type code like_ _&!public funciton {${$method}} (#[SensitiveParameter] null|string $param) {} :#[SensitiveParameter#[OptionalParameter#[SomemoreParameterAttributes]]]string => {(%?MyString)}_ _or fancy shit like {}(){$1 => x {#+}}_ _(No this does not make sense. And yes this is how it will look for beginners. And yes we SHOULD have script languages that are ez readable because we do not have to spare bytes anymore.)_
@AnnaDamm
@AnnaDamm Год назад
Look up annotations in typescript, or decorators in python, they are the same thing
@AnnaDamm
@AnnaDamm Год назад
Also all of those featurea are advanced features. As a beginner, just dont use it
@barneylaurance1865
@barneylaurance1865 Год назад
There was a lot of discussion about what syntax to use when attributes were introduced. One advantage of # being a comment (in older versions of PHP) is that you could write code that worked in both PHP 7.4 and PHP 8. Php 7.4 simply saw the attributes as comments, so it made the upgrade process to 8 simpler.
@orzhovthief
@orzhovthief Год назад
Constants in traits is gold
@orzhovthief
@orzhovthief Год назад
@@phpannotated Basically when i'd like to factorize a behaviour but cannot or do not want to force using class to extend a base class. I did it for emulating enums, for database tables that have recurring columns for example (in which case a constant for the column name is convenient). Basically it can replace the decoarator pattern or serve for some kind of mixins.
@Ilidan1985
@Ilidan1985 Год назад
Great video! Those code examples fly a bit too fast so I had to pause. No big deal but you could keep them for 2-3 seconds longer after finishing writing.
@barneylaurance1865
@barneylaurance1865 Год назад
I still think non-readonly classes should have been allowed to extend readonly classes - make a readonly class exactly the same as a class in which every property is marked readonly. Those properties would be guaranteed readonly also in a child class, but there shouldn't be anything to stop a child class adding rewriteable properties in addition.
@barneylaurance1865
@barneylaurance1865 Год назад
And now there's an RFC to allow that inheritance change.
@yannlescouarnec9814
@yannlescouarnec9814 Год назад
sensitive parameters isawesome. Eager to put it to work to sanitize my logs
@abdmuhaimin
@abdmuhaimin Год назад
Php 8.0 i never try yet, now they upgrade to php 8.2?
@iloginu
@iloginu Год назад
Так мало новых вещей. Даже грустно стало.
@timraiser4811
@timraiser4811 Год назад
G E K O L O N I S E E R D
@nagyzoli
@nagyzoli Год назад
I program for 15 years in PHP and I have never used even one feature presented here. They seem very... specific. Maybe PHP is gearing for a shift in logic?
@ce9916
@ce9916 Год назад
PS: “locale” is pronounced low cal, not low kale. I’m not a native English speaker either, one of those quirks 😊
@pineapplesoda
@pineapplesoda 10 месяцев назад
It's pronounced that way bc it's stolen, I mean borrowed, from French.
@comod
@comod Год назад
I am totally annoyed by your cursor while typing_
@comod
@comod Год назад
@@phpannotated Not your cursor, sorry. I mean the red inspections(?)-line which show up while typing. Looks like you actual type "_"
@klimaluky
@klimaluky Год назад
Далее
Deprecated Dynamic Properties in PHP 8.2
3:25
Просмотров 11 тыс.
I'm also streaming on Twitch now!
Просмотров 15
АХХАХАХАХАХАХАХАХ
00:16
Просмотров 176 тыс.
PHP doesn't suck (anymore)
10:48
Просмотров 205 тыс.
What's New and Exciting in PHP 8 4
9:58
Просмотров 13 тыс.
PHP 8 3 Released
11:03
Просмотров 106 тыс.
PHP on the frontend! No more Javascript!
14:47
Просмотров 122 тыс.
Arenas, strings and Scuffed Templates in C
12:28
Просмотров 85 тыс.
Lazy objects in PHP 8.4
34:37
Просмотров 7 тыс.
The Most Legendary Programmers Of All Time
11:49
Просмотров 557 тыс.