PHP 8 3 Released

Ғылым және технология

Recorded live on twitch, GET IN
/ theprimeagen
PHP article: www.php.net/releases/8.3/en.php
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts

Пікірлер: 334

  • @Taverius
    @Taverius6 ай бұрын

    PHP has been good for years. At the same time, old, unsupported, terminally insecure PHP versions have become the IE6 of backend development. If you learn PHP and want to use that skill for money you have to be super duper extra careful not to end up working on one of these legacy backends, and they are LEGION. There are tens of thousands of company/corporate sites running PHP versions that haven't seen a security update in over a decade. 😨

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    any time i see such an app i feel like it's better to just rebuild it with Laravel and the latest PHP version. the code is probably shit anyways so just extract the business requirements and ignore the old code as much as you can.

  • @TNeulaender

    @TNeulaender

    6 ай бұрын

    I already modernized 2 companies from 5.x to 7.x (few years ago) and 8.x (also some while ago). And to be really honest: I like cleaning up. Especially the first part was a HUGE mess. It was php building html pages with embedded javascript using objects, dynamically created inline in . It was .... marvelous :D

  • @spicynoodle7419

    @spicynoodle7419

    6 ай бұрын

    @@TNeulaender oh man, I love seeing vuejs components with a bit of jQuery and PHP all intertwined. It's the worst. PHP 8 is glorious. It's a lot better than JS

  • @Rakkoonn

    @Rakkoonn

    6 ай бұрын

    Just never take a "PHP" job, only Symfony/Laravel jobs. There is not much to learn about PHP specifically anyway, you are mostly learning frameworks not language itself.

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    @@Rakkoonn then it's the same with Java at least. who builds Java web apps without Spring or that other framework? there are "PHP" jobs. we literally have a position open for that at the company i work in. it's a DIY-ed PHP web app - no framework. (it also sucks but that's not relevant to the point)

  • @steveaguay
    @steveaguay6 ай бұрын

    Php is actually fine now. it's not the most flashy or modern experience but it's good enough. Pair it with laravel and it does a lot of things right.

  • @BeatsByVossy

    @BeatsByVossy

    6 ай бұрын

    PHP pays my bills just fine :)

  • @ThePrimeTimeagen

    @ThePrimeTimeagen

    6 ай бұрын

    i want to try laravel

  • @soroushjm1011

    @soroushjm1011

    6 ай бұрын

    ​@@ThePrimeTimeagenplease try asp for our amusement 😂, we like see you suffer 😂

  • @danielvigh8211

    @danielvigh8211

    6 ай бұрын

    Please make it into a video or I will send you a lexer in php. Take it as a threath @@ThePrimeTimeagen

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    @@ThePrimeTimeagen Try Symfony. Or if you try Laravel try to not to use ambient context (instead of dependency injection) as much as the docs encourage.

  • @fus-ro-dah
    @fus-ro-dah6 ай бұрын

    The clone stuff is actually brilliant. It's for immutability. Suppose you have a readonly class. You can have its properties be public and readonly - so no getters. But before PHP 8.3, you could not derive new copies of instances of readonly classes, unless you go through the constructor. So now we can have a class with immutable methods that can efficiently generate cloned derivations. Ex: $user->withName("New name"); Internally, `withName()` would clone $this and update the name property on the cloned instance.

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    Yeah I wonder if the example on the PHP release announcement is the best example. Something like what you're showing with a `wither` method might be clearer.

  • @Betacak3

    @Betacak3

    6 ай бұрын

    Unfortunately, it's not like that. You can't modify the name property from the withName method. The only place that allows modification of readonly properties is the magic __clone method, which you can't pass any data to.

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    @@Betacak3 Yeah. I guess you could do some hack thing like stuffing the data into a private static property for __clone to pull it out and know what to modify, relying on the fact that PHP is effectively single threaded. Would be ugly but might work fine if you don't have to read the implementation too often.

  • @Betacak3

    @Betacak3

    6 ай бұрын

    @@barneylaurance1865 You can't do that either. On a readonly class, everything is automatically readonly, including static properties. But static properties can't be readonly, which makes sense, because at that point they'd just be class constants. So declaring a static property in a readonly class is actually an error. Out of curiosity, I tried modifying the new instance with reflection, but even that doesn't work. I actually see no way to make wither methods for readonly classes with what we have right now.

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    @@Betacak3 Oh yeah I forgot about that restriction. You'd have to make a second class to hold those static properties. Optionally then the statics could be done via a WeakMap so you have one per instance instead of just one for the object being cloned currently.

  • @justjess5891
    @justjess58916 ай бұрын

    I really do wonder whether Prime would like Laravel or not. IMO Laravel is an antithesis to anyone who likes Go. Go is all about simplicity while Laravel is all magic and abstractions upon abstractions. I would say Laravel is more akin to React or Next.js specifically in that in React/Next.js you are not writing just plain JS, but the React way of writing JS. Similarly, Laravel is not really PHP at this point, but almost like its own language built on top of PHP. Also, just as there are many people who learn React before they learn vanilla JS, there are also many people who jump straight into Laravel without bothering to master PHP and I don't think that is a good thing in either case

  • @SAS-qq5ce

    @SAS-qq5ce

    6 ай бұрын

    Agree, i started with laravel 3 and thought i knew php until i applied for senior php dev position and found out that i knew nothing

  • @JohnDoe-jk3vv

    @JohnDoe-jk3vv

    6 ай бұрын

    That's just a problem with frameworks and people trying to get a job. The framework is there to help the experienced programmers first and foremost. The inexperienced ones are expected to get up to speed on the framework because that's what the company uses. So there's not much time/incentive to master the language first and learn the framework second.

  • @ra2enjoyer708

    @ra2enjoyer708

    6 ай бұрын

    What are you talking about? Out of Big 3 frontend frameworks React is closest to writing vanilla JS, that's why it's pretty easy to slap on typescript (which also supports react templates out of the box) and get all static analysis goodies. You will get the same problems of synchronising state with views, along with reinventing component functions and some kind of declarative way to describe components even in 100% vanilla JS, anyway. Writing basic DOM manipulation boilerplate becomes annoying pretty fast, especially for hybrid render contexts, let alone when you want to change some logic.

  • @rickstrafy4870

    @rickstrafy4870

    4 ай бұрын

    Nette Framework is the way :)

  • @mme725
    @mme7256 ай бұрын

    Random note, a theory on why the PHP namespace delimiter is `\` is because the foreard slash `/` was already the division operator so it was easier at the time to drop the backslash into the parser. Similar reason as to why it didn't use the `::` operator C++ uses, since it was already in use for static calls.

  • @mihalious

    @mihalious

    6 ай бұрын

    If i do understand correctly, that static call is a method defined on classs and not on instance, isn't this exactly how rust uses "::"? use std::collections::HashMap; let m = HashMap::new(); So it's possible to have semicolons for both things(?)

  • @Luclecool123

    @Luclecool123

    6 ай бұрын

    They went LaTeX mode

  • @dzhukov

    @dzhukov

    6 ай бұрын

    They could not use `.` as a delimiter as well because it is reserved for string concatenation in PHP.

  • @mme725

    @mme725

    6 ай бұрын

    @@mihalious the most part yeah. But PHP's parser is different from Rust, and it's got a lot of legacy/BC cruft going on. They could have made it do both and be more contextually aware, but that's just not how it played out historically unfortunately. Fast forward like 14 years now and if you swap it out you break the ecosystem.

  • @hacktor_92

    @hacktor_92

    6 ай бұрын

    actually... it was a whole stuff itself back in the days. look up for "php rfc namespace separator" for more info. in the footnote, there's also the full chat history about why they ruled out `::` ns separator (hint: T_PAAMAYIM_NEKUDOTAYIM)

  • @roelhemerik5715
    @roelhemerik57156 ай бұрын

    PHP still has the most potential in its Foreign Function Interface, as the language was designed with that in mind in the first place. It’s a shame they do not focus more on making that part of the language more user friendly.

  • @j.p.9669
    @j.p.96696 ай бұрын

    Sounds like the deep clone is for updating immutability. So you can change, dump the old object, and move forward with the new.

  • @robmies3257
    @robmies32575 ай бұрын

    Really love your content. Although I have to play it at half speed at times, to understand what you are saying (or play it more than once :) ). Keep up the great work!

  • @connorskudlarek8598
    @connorskudlarek85986 ай бұрын

    The deep clone of read only seems like a way to ensure that your clone does not reference a read only property. It makes a whole new one, and since it's wholly new you can alter the field before it's actually instantiated with read only. If you deep cloned an object with 12 properties, 3 of them are nested read only objects, and one of those read only objects has a value that needs to change-that's where the new feature helps. Since you're only altering one of the nested objects, it can reference the ones that aren't changed and make a new object for the ones that do change. I imagine having a user update their information, but wanting to ensure that it doesn't accidentally get updated elsewhere, is a use case. But I'm a noob and have no idea.

  • @fcolecumberri
    @fcolecumberri6 ай бұрын

    I can feel how Prime wants to do a serious project on Laravel.

  • @SXsoft99

    @SXsoft99

    6 ай бұрын

    wait until he reads about Livewire and compares it to htmx

  • @Nekoeye

    @Nekoeye

    6 ай бұрын

    He's laying the groundwork, a good move to avoid unnecessary criticism from individuals who haven't touched PHP in decades but still feel compelled to comment and assert their relevance.

  • @JeremyAndersonBoise

    @JeremyAndersonBoise

    6 ай бұрын

    PHP isn’t fast like Go or C or Rust, but it is often sufficient, and the tooling is great.

  • @CottidaeSEA

    @CottidaeSEA

    6 ай бұрын

    ​@@JeremyAndersonBoise It's fast enough for most things. Depends more on version and how you do things.

  • @DaviMartins99

    @DaviMartins99

    6 ай бұрын

    Imagine when Prime finds out about Swoole.

  • @Kiyuja
    @Kiyuja6 ай бұрын

    I became a dev in 2019 and in 2020 we had to use PHP for the first time. Even "back then" we still were corrected that PHP is not that slow thing it gets the rep for. Just like Java and C# there were plenty of perf optimizations over the years. Now I personally cannot prove it but I trust the people who told me. Also the project we did ran pretty flawless under PHP. Tho I never really got involved with PHP again :D

  • @blubblurb

    @blubblurb

    6 ай бұрын

    It is by far slower than other languages. But it usually doesn't matter as the bottleneck isn't PHP but other things like the DB. Also it really depends on what you do. If you create the next whatsapp which will be used by billions of people, PHP is probably not the right choice. If you make some Business Solution for some thousands of users I would say, why not.

  • @OzzyTheGiant

    @OzzyTheGiant

    6 ай бұрын

    It's slower than most languagues, but I would argue that it's the fastest of the interpreted ones (PHP, Python, JS, Ruby), at least for raw performance. For async stuff, JS still holds the edge. Multithreading though, not sure.

  • @echoptic775
    @echoptic7756 ай бұрын

    If javascript can be used for writing backends, its time that php gets used for making frontends

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    stop

  • @RedOchsenbein

    @RedOchsenbein

    6 ай бұрын

    Heck, you can use CSS as a backend language. So, why not. 😀

  • @Luclecool123

    @Luclecool123

    6 ай бұрын

    This is so good

  • @peehi2

    @peehi2

    6 ай бұрын

    PHP is frontend bro . Looks like React nowadays

  • @ivanjelenic5627

    @ivanjelenic5627

    6 ай бұрын

    Livewire already kinda does that

  • @zebraforceone
    @zebraforceone6 ай бұрын

    One reason I can think of for doing this is cloning ORM models and you want to clone the table row but change the ID on the model internally. This way you don't have to move data between the database and the API server.

  • @NphiniT

    @NphiniT

    6 ай бұрын

    I was thinking the same

  • @MarisaClardy

    @MarisaClardy

    2 ай бұрын

    It really is just a solution to the always-pass-objects-by-reference problem. A cloned object that had other objects as properties would contain references to the original objects rather than new copies. So in PHP world, this was handled via "deep cloning", i.e., in the __clone method, you clone your objects as well. But that wasn't possible on readonly classes/properties until 8.3

  • @br3nto
    @br3nto6 ай бұрын

    7:19 the had a better namespace separator when they first introduced the concept, but then they changed it to a / at the last. I think the separator was ::, which is used to access static members.

  • @Dantee52
    @Dantee526 ай бұрын

    PHP is really great for small to medium projects...even big projects if you configure it well...Also Laravel + InertiaJS is a gamechanger...And for those who say PHP is slow, how many users do you have?

  • @trentirvin2008

    @trentirvin2008

    6 ай бұрын

    Just as a noob, what makes a language ideal for large projects as opposed to medium/small projects? Is it just in the case of avoiding bugs in a language like java where things are really verbose and harder to write errors in?

  • @ra2enjoyer708

    @ra2enjoyer708

    6 ай бұрын

    @@trentirvin2008 The easiness to slap static analysis on (so you could catch basic errors even before building the code) and the amount of legacy interfaces you have to interact with. Java is more about having a compiler without memory wrangling of C/C++, rather than boilerplate. All three relevant dynamic languages: Python, Javascript and PHP have promoted pretty nasty practices in the past and left a lot of legacy unworkable code around (and even some built-in interfaces lingering to this day) thanks to the lack of static analysis tools.

  • @j-wenning
    @j-wenning6 ай бұрын

    The short-term mutability of a deep-cloned, readonly object seems really nice. In JS you'd have to do something like > const x = { ...data, nested: { ...data.nested, foo: 123 } }; whereas Elixir would have something like > x = put_in(data, [:nested, :foo], 123) So this seems pretty similar to the latter. Looks neat.

  • @patricknelson
    @patricknelson6 ай бұрын

    5:51 - That exists since if you have a read-only property on a class (like “Foo” in this case) that you want to clone, you can’t do a _deep clone_ because that property cannot be updated to be cloned as well (hence the “deep” clone of the lower down references). This update fixes that I guess.

  • @aliendroid8174
    @aliendroid81746 ай бұрын

    I don't know if it applies to php as well but in c++ you might want to deep copy a const ref if you want to ensure your copy isn't changed by the source since it might be a non const passed as a const. It could also be the you want to store it in a specific location

  • @MattDog_222
    @MattDog_2226 ай бұрын

    how could you overlook the new mb_str_pad()

  • @matteobortolazzo
    @matteobortolazzo6 ай бұрын

    Will you give a chance to C# 12 with .NET 8 and AOT? (F# is still ahead on features)

  • @barneylaurance1865
    @barneylaurance18656 ай бұрын

    I've understood the example for deep cloning magic properties now. Yes the final line on the 8.3 side is outside the magic clone method. But that's not where the fatal error is. The fatal error in 8.2 happens on the last line on the left, where `clone` invokes the Foo::__clone method. And clone is needed because although Foo is readonly, the PHP class is not readonly, and has a mutable property. So when making a clone of the Foo object we want a deep clone, that has its own instance of PHP, instead of sharing the instance with the original object. It's a confusing example with an immutable object that contains a reference to a mutable object.

  • @MarisaClardy
    @MarisaClardy2 ай бұрын

    For the cloning of readonly one, deep cloning could not be done before. For those that don't understand this concept, because PHP passes all objects (i.e., class instances) around by reference, if when cloning, you don't also clone the underlying object and re-assign on the newly formed object, then it will still be pointing to the old one, which means if that is then mutable and mutated, it will essentially mutate it in all clones. In the example provided, the PHP class is mutable, so if you didn't reassign the internal ->php on clone, but then cloned the Foo object and then modified the php version, like in the 8.3 version, then the original Foo object you cloned from has the same value. Now, with the 8.3 example, modifying the $clonesd->php->version does not modify it for $instance->php->version. In 8.2 this wasn't possible. I hope that's clear?

  • @apollolux
    @apollolux6 ай бұрын

    Groovy, now all I have to do is make sure that my WordPress clients that I'm unable to manually adjust server settings of due to hosting restrictions that have had their sites working for years don't break due to plugins auto-updating without my knowledge before I get a chance to vet them, or worse - plugins that haven't been updated for a while but are still useful suddenly being considered unusable due to newly deprecated PHP functionality that either I'll have to wait for updates, find alternatives for, or hack in the updates myself.

  • @svndays
    @svndays6 ай бұрын

    Laravel developer experience is way better than rolling your own thing with node, go or python. It's crazy how much more you can get done in the same amount of time.

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    i disagree. the DX can be pretty bad due to magic/generated methods, e.g. on VSCode. i've only seen PHPstorm handle that decently well. meanwhile the DX with tRPC remains unmatched.

  • @spicynoodle7419

    @spicynoodle7419

    6 ай бұрын

    Laravel is the best framework. These NextJS kids don't even know what they're missing. All the shitty services that they have to pay for that Laravel has built in :0

  • @svndays

    @svndays

    6 ай бұрын

    ​ @FunctionGermany tRPC is not a framework, you still have to figure out authentication, permission management, configuration, databases, caching, environments and more. PhpStorm handles it well by default and there's a very good paid plugin that fills in the gaps with model properties and auto-generated hints for the rest of the methods. There's also packages that let you add the properties with static types to your models if you want to do that.

  • @marcs9451

    @marcs9451

    6 ай бұрын

    I completely disagree with the Go part, a dynamic language + framework full of magic will never be as good as a simple and explicit one. Having to write more things is totally worth in the long run

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    @@spicynoodle7419 there's a lot of SaaS nonesense going around in the JS space but you can actually ignore it and build something independent with next.js too. it's just that nobody is talking about it because there's no sponsorship money in a FOSS project.

  • @kristun216
    @kristun2166 ай бұрын

    Deep cloning works great for date classes

  • @XzenTorXz
    @XzenTorXz6 ай бұрын

    Python has just added the override feature as well. I think this feature has been overlooked for too long and is mandatory for OOP.

  • @roy1299
    @roy12994 ай бұрын

    maybe the clone method is useful for reflection class? or for testcases?

  • @Baby4Ghost
    @Baby4Ghost6 ай бұрын

    PHP uses '\' (backspace) as namespace delimiter because '.' (dot) is already used for string concatenation.. I remember this clearly when it got introduced, because that was the drop that filled my bucket and made me abandon PHP. But traits and the new stuff looks damn tempting...

  • @KyleHarrisonRedacted
    @KyleHarrisonRedacted6 ай бұрын

    5:47 as someone who has written PHP near daily since the ye ol' PHP3 days.. I don't get the deep cloning situation. I can't even think of a scenario where I'd find myself in where that'd be a useful or even desirable thing to do

  • @BillLambert

    @BillLambert

    6 ай бұрын

    I'm guessing it's an optimization for things like PSR-7 objects, which are meant to be immutable so every time you mutate one, it hands you back a brand new object with cloned data instead.

  • @user-ir3yw8bs4i
    @user-ir3yw8bs4i6 ай бұрын

    Prime, you are the best thing that happened to youtube, after youtube itself :)

  • @mldy1
    @mldy16 ай бұрын

    they didnt do a major version bump presumably because it is backwards compatible

  • @loek8638
    @loek86386 ай бұрын

    Bro, php has match operators and js still don't

  • @keyboard_g
    @keyboard_g6 ай бұрын

    Change only once readony properties are supporting init only properties from within clone?

  • @CottidaeSEA
    @CottidaeSEA6 ай бұрын

    I work with PHP regularly, it's usually a pretty nice experience as long as I'm just building new stuff. Delving into the old stuff is usually painful, but that has more to do with the overall architecture and loads of ugly fixes that you need to keep in mind 10 files away in order to not break shit. That along with an overall reluctance of using classes for loads of things, meaning you have documentation which says "returned array has these keys" but does in fact not have those keys.

  • @stilldreamy5181
    @stilldreamy51816 ай бұрын

    I think they put too much emphasis on being able to deep clone readonly properties with that explanation. I think the bigger deal is being able to modify cloned, readonly properties period, not necessarily for the purpose of deep cloning them. Otherwise the cloned object can never have different values for the readonly properties. I think this is a good stepping stone to further improvements in the future if they add something like `clone with` where you specify which properties of the clone should have new/different values. You can do something similar in Kotlin and Scala 3. It's great for making immutable classes because if everything is immutable, how do you change anything? Well you don't change the object, you clone it with differences. Currently you basically have to duplicate the constructor in a hand rolled cloneWith() method for every single class you make.

  • @mt1104uk
    @mt1104uk6 ай бұрын

    Have they fixed the docs yet so you don't have to read comment 15 to find out the function does something random you need to be aware of.

  • @donwinston
    @donwinston6 ай бұрын

    PHP has come a long way in the last fifteen years.

  • @MadalinIgnisca
    @MadalinIgnisca3 ай бұрын

    Would you make a review on openswoole on php?

  • @sevilnatas
    @sevilnatas6 ай бұрын

    You clone the const to a new instance, change its value and then it is locked as the const that it is? You get one free change of value at time of cloning, and then that's it, locked?

  • @daltonyon
    @daltonyon6 ай бұрын

    You should do Advent of Code in PHP hahaha I think that has been more than 3 years working with PHP, and it isn't so bad like I did think

  • @AdmiralSnackbarz
    @AdmiralSnackbarz6 ай бұрын

    Will the Primagen switch to PHP after this update?

  • @fnfal113
    @fnfal1136 ай бұрын

    When laravel does most of the stuffs without causing you pain that react server components is trying to instill.

  • @DarkStoorM_
    @DarkStoorM_6 ай бұрын

    Damn, the chat trying to figure out what a Fully Qualified Name is

  • @tolluset
    @tolluset6 ай бұрын

    "use php"

  • @xcrap
    @xcrap6 ай бұрын

    PHP + HTMX, you may enjoy it.

  • @DerIche
    @DerIche6 ай бұрын

    finally one video about not hating php

  • @rafagd
    @rafagd6 ай бұрын

    3:45 - In PHP, everything is copy-on-write references, if passed "by value". There's no syntax to get a reference, what you can do is force the creation of aliases that act as references [using the =& operator]. You can also declare a parameter as "receiving a reference", which is actually pretty bad, because the user never knows their variable could potentially be used as a output parameter, so it is better avoided. eg: you can function abc(&$var) { $var = 0; }, when you call it abc($input), input will become 0 even if you never expected it to be a reference pass. For the clone, readonly props can only be modified inside the constructor. That change makes it possible for you to reinitialize readonly stuff after a clone, if necessary. Not sure I like it, but that's what it is.

  • @GreyDeathVaccine

    @GreyDeathVaccine

    6 ай бұрын

    Objects are passed by reference. If you care so much why not use simple stdClass object and assign your data to it? 🙂

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    @@GreyDeathVaccine Objects are not passed by reference. Objects are not passed at all. References to objects are passed by value.

  • @rafagd

    @rafagd

    6 ай бұрын

    ​@@GreyDeathVaccine I have no problems with passing stuff by reference, my problem is when you're passing an argument that you don't expect to become magically a reference, say an integer, and the function changes that argument to whatever crazy stuff it wants to change it to. Usually not a problem with std api, but users are crazy. In PHP you also have 0 visibility over what parameters are going to be by-reference and what parameters are going to be by-value, from the function user side. Also, since php tends to be copy-on-write everything, there's usually not a whole lot of stuff that you actually want to pass by-reference anyway...

  • @rafagd

    @rafagd

    6 ай бұрын

    @@barneylaurance1865 Exactly! Assume you have 2 functions: function a($v) { $v->foo = 0; } function b(&$v) { $v = 0; } Then you have a value: $c = new Something. if I call a($c), I wouldn't be surprised by something changing inside it, but $c itself is still the reference to that obj. Now if I call b($c), it's a footgun that has just destroyed any hopes that I can debug this shit in less than a day. $c isn't the reference anymore, $c is something else entirely. It's passing a reference as a reference and the user of the function has NO IDEA that that happened.

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    Isn't it just arrays that do copy-on-write? I thought the other primitives were just copied directly.

  • @redpillsatori3020
    @redpillsatori30206 ай бұрын

    I just hate how so many PHP sites have `index.php` at the end of URL. I always thought that it was tacky.

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    it's "more accurate" and requires less config on the web server.

  • @javierflores09

    @javierflores09

    6 ай бұрын

    You can remove that in literal seconds but people just don't bother

  • @SXsoft99

    @SXsoft99

    6 ай бұрын

    i think it's more related to SEO indexes for old websites because people don't want to know how to forward google bots

  • @MrWerminghoff
    @MrWerminghoff6 ай бұрын

    feels illegal to be here so soon

  • @PbPomper
    @PbPomper27 күн бұрын

    So __clone is like the init property in C#?

  • @jjones503
    @jjones5036 ай бұрын

    PHP has always been the best language. Change my mind.

  • @user1234-iu1jg
    @user1234-iu1jg6 ай бұрын

    PHP > JavaScript.

  • @TheMedjunior

    @TheMedjunior

    6 ай бұрын

    Facts

  • @aydingolchin

    @aydingolchin

    6 ай бұрын

    No.

  • @kon-jakub

    @kon-jakub

    6 ай бұрын

    why are you geh?

  • @Necessarius

    @Necessarius

    6 ай бұрын

    Based

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    typescript though

  • @Rahul79821
    @Rahul798216 ай бұрын

    Those back slashes are php thing irrespective of OS.

  • @daved3464
    @daved34646 ай бұрын

    PHP always passes objects by reference so cloning an object with a readonly object property will have the cloned object have an readonly object property referencing the same readonly object as the previous one. So by making a clone of the readonly object property in the magic __clone method prevent the side effects of modifying something in the readonly property and making the program go funny (that being the same referenced object in both the original and cloned instance)

  • @mvargasmoran
    @mvargasmoran6 ай бұрын

    Hell yeah! I'm not going back tho.

  • @Kiba114
    @Kiba1146 ай бұрын

    php is a must for web

  • @enkiimuto1041
    @enkiimuto10416 ай бұрын

    Honestly, I decided to try Symfony and... it was a text wall just for some basic posting... meanwhile in Django it was like 9 lines. Not worth it.

  • @Necessarius
    @Necessarius6 ай бұрын

    PHP has grown up, but not everyone’s programming skills have kept pace. Let’s give credit where it’s due: PHP's not the problem, it's waiting for some programmers to catch up! But they still keep hating lmao

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    PHP hasn't been the problem since v7 i'd say. however, PHP suffers heavily from what i call the PHP-bootstrap-jQuery-syndrome which is when a technology is so accessible that it attracts many inexperienced and untrained developers, resulting in the majority of code written with that technology being very low quality, therefore giving that technology a bad name.

  • @fnfal113

    @fnfal113

    6 ай бұрын

    @@FunctionGermany Then AI trains on shit code written by humans, we are doomed.

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    @@fnfal113 yeah 😔. stupid devs using GPT to write code from 2008 stackoverflow that got 1 upvote (the author).

  • @P8860

    @P8860

    6 ай бұрын

    @@FunctionGermany ouch! I feel attacked but painfully true

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    @@P8860 don't feel attack. there must be technologies that a lot of junior devs use, otherwise we'd have a lot less software developers today. pretty much all developers need to write a lot of bad code as a byproduct before they can make anything good.

  • @Loutistic
    @Loutistic3 ай бұрын

    "This person must be working on Windows" got me.

  • @johanneswelsch
    @johanneswelsch6 ай бұрын

    This is the reason the only language I like is Go. It don't like when new features are introduced every week. I like having one way of doing things.

  • @AScribblingTurtle
    @AScribblingTurtle6 ай бұрын

    2:30 : Backslash is the separator for namespaces. Similar to how a "." would be on a Node package name. 3:08 : Not a huge fan of the #[\Override] annotation but It would make maintaining stuff probably a bit easier. I don't understand why we couldn't just have a PHPDoc @override comment instead. That whay The Language Server could do the same checks. By using an annotation, PHP now has to check this stuff, whenever it loads a script.

  • @ivanjelenic5627

    @ivanjelenic5627

    6 ай бұрын

    There were discussions when it was being added. Iirc they didn't use @ because that's the operator for error message supression

  • @AScribblingTurtle

    @AScribblingTurtle

    6 ай бұрын

    ​@@ivanjelenic5627 The Problem I see here, is, that it uses the # symbol, which does make it a comment already. But it is a comment, that is now executed / evaluated at runtime instead of just during writting in the IDE. With PHPDoc it would be something like /** @overrides [propertyname] */

  • @kevinyardie9135
    @kevinyardie91356 ай бұрын

    Jamaica 🇯🇲 in the building love your videos bro

  • @redpillsatori3020

    @redpillsatori3020

    6 ай бұрын

    Ya mon. Welcome

  • @kevinyardie9135

    @kevinyardie9135

    6 ай бұрын

    @@redpillsatori3020 huh! Like really bro you bugging 🤣🤣🤣🤣

  • @zeocamo
    @zeocamo6 ай бұрын

    the \ is for namespaces

  • @judedavis92
    @judedavis926 ай бұрын

    Im getting a lambo now

  • @LuizGustavoAgostinho
    @LuizGustavoAgostinho6 ай бұрын

    PHPagen 😀

  • @32zim32
    @32zim326 ай бұрын

    In my test php swoole was faster then go in typical microservices scenario, surprise

  • @taylorkoepp3048
    @taylorkoepp30486 ай бұрын

    I'm not a PHP man but I would definitely pick a Laravel project over a React project (actually there isn't much I wouldn't pick over a React project).

  • @marble_wraith
    @marble_wraith6 ай бұрын

    PHP didn't used to break backwards, which was the problem with the language for a long time. There'd be old stuff they'd mark as "deprecated" but people would still use it. Now they brokeback... 😏

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    They try to keep most of the BC breaks for the x.0 major releases, i.e. they're saving up thing to break in 9.0. But there are always a few BC breaks in the x.y releases like this year's.

  • @ManWhoLostTheWar
    @ManWhoLostTheWar6 ай бұрын

    i love you prime, youre my goat

  • @necastiv11
    @necastiv114 ай бұрын

    PHP namespaces resembles the folder structure of the file. Why they use \ \ \, its because you can have 2 functions with same name but different namespace. So you can import both functions but just point to right namespaces. You than need to use as word to rename inports from namespace.. bla bla

  • @TheKomaras
    @TheKomaras6 ай бұрын

    Would be nice to see you go through Laravel :)

  • @EngineerNick
    @EngineerNick6 ай бұрын

    if they remove the dollar sign from variable names i'll look at it

  • @theshinyplayer2373

    @theshinyplayer2373

    6 ай бұрын

    PHP is all about that money.

  • @semyaza555
    @semyaza5556 ай бұрын

    1:33 Lmfao

  • @barneylaurance1865

    @barneylaurance1865

    6 ай бұрын

    Has he seen PHP's variable variables?

  • @gogogomes7025
    @gogogomes70256 ай бұрын

    What's next, Perl 6?

  • @oldcastor-
    @oldcastor-6 ай бұрын

    not really most pushing forward release lol not a single example of performance, but in general php8+ going good

  • @stilldreamy5181
    @stilldreamy51816 ай бұрын

    Php is getting better. For people already using php, all these improvements are very nice to get. But php will always be worse than a nice, well designed, statically typed, compiled language. Comparing PHPStan or Psalm to a real compiler and the way it reports issues is night and day. Php static analyzers are not part of the language, they are these tacked on things made by the community, and therefore will never be as nice as a compiler that is required and part of the language. Also, php is overly verbose. `readonly`, arrows just to call a method, a dollar sign before every variable. Those might seem like small things, but it all adds up. Compare it to a language like Scala 3 where it is both terse and expressive/readable at the same time.

  • @webdevnoob
    @webdevnoob6 ай бұрын

    Bro, PHP namespaces has been around since v5.3 I think, that's like some 15 years ago. Those slashes has meaning in auto loading classes via Composer. I think your idea of PHP as "garbage" is extremely outdated. Seems to me your idea of PHP is still in the v4 era -- where PHP was ironically king because everything else actually suck. Now I've no hate for Laravel but even that doesn't represent how really different and good PHP is now. Just plain PHP + PSR + Composer libraries cuts it on its own. If you really want to use a framework, Symfony is a good choice -- less magical and closer to native PHP. You have to try modern PHP and you'll see, but don't just go blindly and write in procedural PHP 4 like you used to. At least read on PHP The Right Way and you're good to go.

  • @kippie80
    @kippie806 ай бұрын

    I'd used PHP lots back in 2000, I'd stopped using awk grep, etc. in command line tools! But nah, I'm sorry, not interested. And yes, I still use good'ol bash. Never need awk as much as used to though ... funny that. I suppose data system integrations are better.

  • @Oprekode
    @OprekodeАй бұрын

    am still use php 7.4

  • @MichaelAbramo
    @MichaelAbramo5 ай бұрын

    If you have to put a dollar sign before every variable name, you've already lost.

  • @kriffos
    @kriffos6 ай бұрын

    Backward compatibility breaks in minor versions is stupid, they should just follow good old .. version scheme. I like the new features PHP is getting, but they should really wipe out the inconsistency in the language, that would be a great breaking change worth another major version.

  • @FunctionGermany

    @FunctionGermany

    6 ай бұрын

    some projects have their reasons for not following semver. maybe regular, smaller breaking changes motivates more teams to update in comparison to major breaking updates which creates demand for supporting the old version or LTS versions.

  • @marcs9451

    @marcs9451

    6 ай бұрын

    pho was created before SemVer was popular.

  • @kriffos

    @kriffos

    6 ай бұрын

    @@marcs9451 that's not true at all. SemVer is a relatively new term but the general procedure is really old.

  • @SXsoft99

    @SXsoft99

    6 ай бұрын

    they only removed some inconsistencies that devs should have stayed away anyway

  • @kriffos

    @kriffos

    6 ай бұрын

    @@SXsoft99 sure, that may be the case. To avoid having to know such internals, e.g. as an administrator, it is nice to follow the versioning rules. After all, that's the whole point.

  • @TheBlackmanIsGod
    @TheBlackmanIsGod6 ай бұрын

    Been trying to learn PHP since PHP 5, now was trying to learn PHP8, now it’s gone to PHP 8.3 before I could get used to PHP8……. The tech is coming out and updates are so fast nowadays how can anyone keep up?!?!?

  • @wolizuka

    @wolizuka

    6 ай бұрын

    By sticking to the technologies you chose for a project for as long as it's reasonable to do so, and not changing the minute a new version/framework comes out. I don't think PHP8 is irrelevant just because 8.3 came out.

  • @TheBlackmanIsGod

    @TheBlackmanIsGod

    6 ай бұрын

    @@wolizuka nobody is looking for someone hood in PHP 5, when PHP 8.3 is out…. Same with PHP 8…. As new tech comes out that’s what these jobs want to hire people who have mastered the newest tech

  • @SXsoft99

    @SXsoft99

    6 ай бұрын

    5.6 28-Aug-14 7 3 December 2015 7.1 01 December 2016 7.2 30 November 2017 7.3 6 December 2018 7.4 28 November 2019 8 26 November 2020 8.1 25 November 2021 8.2 8 December 2022 8.3 23 November 2023 how were you not able to keep up? one year is enough to check what's new and refactor the code

  • @javierflores09

    @javierflores09

    6 ай бұрын

    ​@@TheBlackmanIsGod that's just not true? a hefty amount of jobs orbit around maintaining existing code, which is often a few if not several versions behind whatever is the latest thing. As long as there are no security fixes which haven't been backported, there's virtually no reason to update other than improved DX when it comes to established languages. All of that said, it is quite the exaggeration to say "how can anyone keep up" when few things have been actually added, none of these changes have been paradigm--shifting or anything of the sort and in reality there hasn't been any fundamental changes to the language so if you know PHP 5, you're 95% of the way there to PHP 8

  • @HyperionStudiosDE

    @HyperionStudiosDE

    6 ай бұрын

    Nonsense. First of all 99% of the language remains the same. Second of all you don't need to know everything, just know it exists and look it up when you need it.

  • @monstercameron
    @monstercameron6 ай бұрын

    this looks messier than rust code

  • @JEsterCW

    @JEsterCW

    6 ай бұрын

    Fax

  • @peehi2
    @peehi26 ай бұрын

    WEN LARAGEN

  • @Stoney_Eagle
    @Stoney_Eagle6 ай бұрын

    You say you wouldn't hate Laravel, I say you'd like it.

  • @JLarky
    @JLarky6 ай бұрын

    I like how this video started with "I think PHP is trying to become a real language now" and the whole video is "what the hell is this garbage?" 😂

  • @Im_Ninooo
    @Im_Ninooo6 ай бұрын

    nah, thanks I'll stick with Go.

  • @TariqSajid
    @TariqSajid6 ай бұрын

    why your videos are not 4k ?

  • @charliea6038
    @charliea60386 ай бұрын

    PHP looks like java now

  • @luigibattaglioli6026
    @luigibattaglioli60266 ай бұрын

    Everyone hating on PHP has obviously never built anything with Laravel and they don’t know what they’re missing out on 😔 best developer experience and community I’ve ever experienced.

  • @ctxz9580

    @ctxz9580

    6 ай бұрын

    i've built a few projects in laravel over the years. It's full of bloated code and bad design patterns. Using standalone packages is much better and it makes your projects much more stable. Frameworks lock you in and make it difficult to change 1 aspect without affecting something else, because it's all tightly coupled. Which some claim is a benefit, and i have no idea why they say that, but neither to they 😂

  • @RomvnlyPlays

    @RomvnlyPlays

    6 ай бұрын

    @@ctxz9580you are but a novice - unable to understand beauty & grace

  • @ojsojs6004

    @ojsojs6004

    6 ай бұрын

    ​@@ctxz9580 you don't understand what you are doing.

  • @shogo6
    @shogo62 ай бұрын

    phpagem

  • @joshuasy10
    @joshuasy106 ай бұрын

    Strike me down with all of your hatred, and your journey towards the dark side will be complete!

  • @ever-modern
    @ever-modern6 ай бұрын

    Prime's attempts make me wonder how much he makes off of sifting through this crap. Would take a lot to make me do the same.

  • @XDarkGreyX

    @XDarkGreyX

    6 ай бұрын

    You need some ice?

  • @emceha
    @emceha6 ай бұрын

    Objective opinions about php? Imposibru

  • @SurenEnfiajyan
    @SurenEnfiajyan6 ай бұрын

    Those features don't seem very popular. What I really want from a serious typed language, is support of generics.

  • @SXsoft99

    @SXsoft99

    6 ай бұрын

    /** * @var Collection $list */

  • @CottidaeSEA

    @CottidaeSEA

    6 ай бұрын

    That can be achieved in PHP through a build step. Works quite well, but I wouldn't use it in production.

  • @SurenEnfiajyan

    @SurenEnfiajyan

    6 ай бұрын

    @@CottidaeSEA You mean something like typescript?

  • @CottidaeSEA

    @CottidaeSEA

    6 ай бұрын

    @@SurenEnfiajyan Basically, yes.

  • @soniablanche5672
    @soniablanche56726 ай бұрын

    PHP was never backward compatible and that's why it's a pain in the ass to update Laravel projects, which in itself isn't 100% backward compatible either lol.

  • @timurrte5694
    @timurrte56944 ай бұрын

    Just accept that PHP is better in any way than JavaScript

  • @roccociccone597
    @roccociccone5973 ай бұрын

    I used to hate PHP but I'll be very honest, I'd rather make a new application with PHP 8.3 than with node or even python.

  • @fldgr
    @fldgr6 ай бұрын

    I thought it said 3 days ago - but it was 3 minutes ago. Anyways PHP is the one true superior language.

  • @martinhotmann7868

    @martinhotmann7868

    6 ай бұрын

    Sorry just not superior in anything.. If you disagree, name in what it is superior to everything else.

  • @hitthemill8595

    @hitthemill8595

    6 ай бұрын

    @@martinhotmann7868being bad

  • @martinhotmann7868

    @martinhotmann7868

    6 ай бұрын

    @@hitthemill8595 True that ^^

  • @javierflores09

    @javierflores09

    6 ай бұрын

    @@martinhotmann7868 superior ecosystem. You can't go wrong with Laravel but if you feel like something different there's also Symfony, that's kinda about it for the majority of devs. You don't have to play catch-up with every other framework trying to reinvent the wheel, or completely changing paradigms between versions

  • @thejezzi5219
    @thejezzi52196 ай бұрын

    Still waiting for that big major update that reduces the set of features

Келесі