I have much regret to inform you all that Beastco, commonly referred to as Big Dick Daddy from Cincinnati, wishes to thank everyone but his YT account contains his real name and he refuses to use it with all of you degens due to your degenerate behavior
Did not realize this was the creator of the video Prime is watching, thought this was just a nice guy thanking me for watching Prime and telling me I was the best 😂
Fun fact: PHP’s creator Rasmus Lerdorf is from the tiny country of Denmark. Who else is from Denmark, you ask? Well, the creator of TypeScript - and C#. And the creator of Ruby on Rails. And Google’s V8 engine which finally made JavaScript fast enough to be taken seriously as a contender on the server side - also built in Denmark. Edit: Also the creator of C++. All this (and more, but this is getting long) from a tiny country of 5M people living mostly off LEGOs and bacon.
Nothing wrong with PHP. I've made a career out of fixing PHP apps and with the exception of huge enterprises with millions of users, PHP is more than fast enough for 99% of scenarios.
I used to worked on a decade old php 4. codebase that 1.5GB in size without any external libs or packages. With all the SQL in PHP in JS in HTML glory In local machine it take 3 minutes to a single button to load, and a use case is like 15-16 button. It took hour just to see the error. And somehow on production it still land in ms After that codebase i dont believe there is any language that is not "fast enough"
Some things he didn't mention: - mysql calls can be made asynchronously. - cURL can be asynchronous. - class preloading can be used to significantly reduce process boot up time. - close to complete implementation of object oriented programming from other larger languages - two technologies exist which can cross-compile PHP to C++
@@Runeite51 no, but that's a third option i didn't think about. Sorry, i have not used it yet so i don't know details on how they work, only that they exist and look viable.
@@rcnhsuailsnyfiue2 I dunno, i'm aware of this stuff just in case i ever need it. Right now PHP is plenty fast but i wanted to know if a 10x speedup was possible if i ever need it. Seems feasible
@@rcnhsuailsnyfiue2 yeah I've been on the prowl for something to let me code in C + access to php when needed. Only viable option I've come to find is to build a php extension (FFI has weird limitations and calling exec() to many times is expensive and awkward, and I don't want to invoke script tags to do it)
I started learning PHP during my apprenticeship and the teachers still gave us the 7.3 executable (yes it wasn't that long ago). I read the changelog when php 8 was getting ready to release and my mind was blown when I discovered pattern matching.
Seeing your mind get blown by traits alone made my day. Thank you. Traits have been around since PHP 5.4. So even if you only get to work on legacy code, chances are you can still use Traits and I love them. Array destructuring was possibel even pre 7.1 via the list() function. It just got a bit more convenient to write. Some of lists()s downsides still exist. PHPs improvement is slooooow, but as we Germans say "Gut Ding will Weile haben". Or in other words "Good things take time".
The benefits of PSR standards are clearly evident too. Recently upgraded Slim 3 to 4 and VS Code is now able to pick up the framework's types much better due to those standards.
@@marcusrehn6915 Traits only add a bunch of properties and methods (even static ones) to a class. The trait itself does not have its own state. As far as I know. It is more akin to an Include but for definitions inside a class. You can access a property of the using class from within the trait because the properties of the trait are just copied to the using class and thus become properties of the class itself. Semanticswise I will not argue. Arguing is pointless, since Mixins and Traits solve the same problem in very similar ways. Different Languages implement different concepts under different names.
If anyone is interested in understanding how massive the PHP performance optimization was at version 7, there's this talk at ua-cam.com/video/fYTKm2oUzAg/v-deo.html where the PHP creator, AKA Rasmus Lerdorf, goes into some of the points that made PHP 7 so much faster. At some point, he explains how upgrading from PHP 5 to 7 would reduce the CO2 emissions from servers by 7.5 BILLION kg yearly, which is pretty insane.
My first big language was PHP, so it has a special place in my heart. I can't believe all the great improvements in it since I left it a decade ago. Wow. Very cool. Great video.
In my non scientific empirical research for the last 10 years 10% of people who hates PHP have actually used it & hates it for valid reasons and 90% hates it because hating it is "cool" but can't provide a single reason as to why they hate it, or they use it out of "scope". As a general programming language it sucks, for web it is more than capable for 99% of the devs for it's intended usecase, it is a great "get shit done" language, but some people take it way to seriously ;)
And this is one of the big misconceptions. PHP can be run as CLI for decades. It does need a web server to run, and it can be certainly used for non web things just like python, being faster as well for the same tasks.
you cannot use variables in functions with ease, it's slow, it's error messages were ugly, it's don't have any keywords for defining variables, there is no object literals or structs, you have to write associative arrays, it's support of utf-8 is very low and a lot of versions has various security vulnerabilities, also wordpress and it's plugin system also sucks, when you don't update your plugin you could easily hacked by someone other. That reasons are a few just i remembered right now.
@@haliszekeriyaozkok4851 >also wordpress and it's plugin system also sucks, when you don't update your plugin you could easily hacked by someone. Ok, so that is wordpress's issue. Not PHP.
did you actually learn Inertia AND Livewire? Because I'm over here struggling to even get started with one of them. Not because it's particularly hard but because I've been programming for ten years and my resistance to learning anything new is annoyingly high
@@holonaut I did! Inertia is pretty seamless. You bring React or Vue and just use it. Laravel manages state and routing for you server side. Livewire has a steeper learning curve since you can’t lean on existing knowledge, but once you get it you can move incredibly quickly in the full stack, even faster than inertia.
@@holonautLaravel + Inertia + Vue here. Well if you know Laravel, using Inertia is a breeze. You can skip API code and write just like for normal views. It's wonderful. 👍
I worked with PHP/JS/TS/GO/Dart/Python, and php is still my goto language for new web projects. it's the most "it just works" language out there, no compilation, great package managers, decent speed, ...
@@khangle6872 PHP is thinked for concurrent requests, not for a unique process that has multiple threads. It could be useful if you use something like websockets where you have only one process that runs a server, but not for just plain websites with maybe some ajax.
@@khangle6872 PHP is thinked for concurrent requests, not for a unique process that has multiple threads. It could be useful if you use something like websockets where you have only one process that runs a server, but not for just plain websites with maybe some ajax.
There are a lot of design decisions outside the language and interpreter that can be made to improve performance, in most cases, but Swoole does look compelling!
Dude I've been programming for almost 25 years now, and I've only just discovered you. I must say I've gotten a big boost because AI also makes my programming life so much easier (especially with other languages that I now feel very comfortable to just dabble with for an afternoon), but this is so good. You get me hyped for things I've been doing for years. This is quite refreshing after watching thousands of tutorials. Disclaimer: I'm not into gaming/discord as I would lose myself and my sanity, so no twitch and all it's goodness. Glad you also share it on UA-cam.
PHP literally stole all the good junk from every language right now and just jammed it into PHP 8. Absolutely fantastic to work with compared to Python or JS/TS. Unfortunately, I'm looking to use a default language that has more than just back end as its use case, so I'll probably be using Go, Kotlin or C# for that, as they all compile AOT and are easier to deploy rather than having a fat Docker container. PHP though, is definitely the most optimized language for straight up back-end web dev.
I just watched this and was thinking about how kotlin had all this already in like 2015, also if you work with php chances are the version will not be 7/8....
PHP used to suck because there was nothing worse on the web apart from ASP Net maybe. Nowadays, in the world where react server components exist even PHP5 doesn't look too bad. I mean, if you just render html server-side and don't go super fancy with all these modern restful microservices, php is actually great.
My argument against server side rendering exactly: if I wanted to do that, I'd be back in PHP I want cached client code and lightweight server execution damnit
I love variadic arguments. I love them so much, I implemented a polymorphic function using variadic arguments in MSVC's particular flavor of C . . . and now I hate variadic arguments, I hate my life, I hate everything, may God have mercy on the soul of whoever decided that MSVC was not going to support ISO C and thereby leading me down the wrong path for a solid 3 hours of constant swearing. May God have mercy on his soul, because I might not.
@@amrojjeh honestly, just use wsl if you want to do C on Windows. Go to the command line, run "wsl --install", reboot, run "wsl" again, and voila! a POSIX-compliant bash shell running in a Ubuntu virtual machine that you can then install GCC on. Because yeah, Windows support for C is abysmal, and trying to dance around the differences between MSVC C and ISO C17 is massively confusing for a new programmer like me.
@@l3lackoutsMedia hey, I don't mind variable length argument lists, I just particularly hate MSVC's particularly garbage syntax for it. ISO C's syntax is already pretty mid, and MSCV's particular "improvements" make me want to throttle someone.
Traits are complete bullshit... they can access props of classes and other traits. It makes complete mess. That's why I hate Laravel. And that's one of many reasons why I quit from PHP
@@oliverfoxiPHP-Traits are just a fancy copy-paste. Might be useful for some helper functions here and there, especially in unit tests, but for "regular" use, use them rarely.
Watching this has made me feel so much better about being forced to learn PHP for my Web Dev class. It looks like I could actually enjoy writing some PHP. Thank you Aaron and Prime. P.S. Happy Birthday Beastco!
The point about having more information at a language level makes me think that the modern model for writing a new trendy programming language is "abstract away from the computer but don't abstract away from what the computer is doing" I want to be able to read and understand my code at a human level but it's being written for a computer to execute. as much as a garbage collector can take care of it, it's important to know as programmers that we are telling a *computer* to do the stuff and languages can abstract away as much as they want but it's kinda useful for us to know when we're talking to the computer vs talking to the next person who's been hired to maintain our codebase. sometimes I prefer added verbosity over syntactic sugar cos I actually get a sense of what is going on
@@Pictor13 Can you give an example? If you mean dynamic type assignment for a variable, then that's something which exists in Java as well through var.
It always cracks me up to see PHP haters get BTFO'd in real time. Also, regarding performance, PHP running on top of Swoole is actually fast af. You should look into it.
php swoole is used in Asia for tens of millions of concurent users, western dev world just looks for latest flashy stuff and still thinks of PHP of the early 2000s 😆
Im currently writing a new project in php 8.2 with Symfony, it's fine. Pretty much on the level as other languages, just a bit less elegant in many places.
@@coldestbeer laravel is for non-programmers, its too much magic under the hood, for people starting out is amazing, they have no clue their ORM is going to pull X numbers of records just to count them in-memory and display that number, on EVERY REQUEST, so yeah, localhost with 10 records = yay, produciton with 10k records = ugh; but most laravels people just code, deliver, get paid and bye bye, they dont know or care.
@@coldestbeer Mostly because I've been using Twig and Swiftmailer for years so Symfony was the natural choice. Also Symfonycasts makes it very easy to get started.
less elegant ? Can you give some examples ? I specifically like PHP because (and maybe I'm too biased) the syntax it's the best for me, makes the most sense. Not too cryptic, not too verbose, just the right amount of practical and descriptive.
A few days ago, when the php video came out, I was about to go on a mission to post the link to this video as a comment on each of your new videos. I'm glad this video reached you without me having to do anything. To the person who shared this video, thank you, you're a champ. ❤
@@holonaut Well, most people who didn't specialize in PHP but had to deal with enterprise got stuck on < 5.3, due to blocking support for the deprecated but still in use primal Zend. And anybody that didn't need PHP in the first place was either an asp runner or just hopped on the train to use Node.
Arguably, if you’re processing >50k req/s it’s an everything issue. You’ll want to distribute the load; cache the crap out of any data those requests need as you definitely don’t want to do any disk or network I/O; a nice trick is to strip away the frameworks and language runtimes entirely and go straight nginx low level configs; you’ll even want to tune your network stack/drivers just so you’re not leaving any performance on the table.
So many other awesome things that weren't mentioned in this video as well. Composer is probably one of the best package managers I've ever used. We have Fibers built into the language (though they are a little unwieldy right now without specific libraries). Using Psalm or PHPStan, you can have compile time type checking with all sorts of more advanced types (in comments) such as generics. You can also destructure string-keyed arrays. The ecosystem has a standards body that allows us to utilize any implementation of certain things (like caching or logging) interchangeably. Need Async logs? There's a package for that. Needs logs sending to XYZ? There's a package for that. And there is just soooo much more great things to say about the PHP ecosystem.
Problem is a lot of php codebases (that I've seen anyway) were made in old versions of php, which does suck. Even if new php is better, I'd still rather use a lot of other languages instead for new stuff
100% this, never going back to php it is 99% not php 7/8 with some hiodeous dependency on some shity wordpress instalation with a custom hacked plugin that a developer once tailormade in 5 years and left the company 10 years ago with 0 documentation and obfuscated code that was never touched/refactored or corrected(bugged from day 1 when wordpress was upgraded from 4 to 5)
I started during the PHP 5.6-era (I was 14 back then) and started taking it serious around PHP 7.0 (I was 16 or so) so I never understood the hate against PHP. Mainly because each time tried to hate on it, their arguments could literally be debunked with: "That's not an issue", either because PHP added that or because it an issue was so, so, so specific that you'd have to actually *try* to purposefully trigger that "issue" rather than stumbling upon it. Nowadays I mainly use TypeScript with Deno but that's because it has async/await (which PHP sadly still doesn't have) and allows me to create stuff like Discord bots without scuffed hacks like AmPHP or ReactPHP.
For the async/await, couldn't that be done with Swoole ? It's an official server which can do sync, async, fiber and I think everything inbetween. Haven't used it, but it looks interesting, I can't wait to try it out.
@@Winnetou17 While I think Swoole is a step in the right direction, it suffers the same issues as AmPHP and ReactPHP which make it feel more like a "hack" rather than a "solution". Additionally, it lacks a form of "await" so I have to pass a callback to an async handler (eg. `Swoole\Async::read($file, function($res){})`) rather than just say `$content = await Swoole\Async::read()`. There was a library called "Swoole Futures" which added this syntactic sugar which does come very close but not quite close enough.
I was fortunate enough to do a stint with a company building their web-site with C#. I ended up modeling my PHP framework around that back in 2009. That saved me a lot of pain. PHP lets you code like a buffoon. But has always given the tools to write clean code if you put in the effort. Since PHP 5.2 didn't have types, so I built my framework around classes because I could at least ensure you weren't setting and getting magic properties by overloading __get and __set with a code base class that all classes extended from.
The problem with PHP is that it's jam packed with foot-guns. It can perform great and have lots of sugar but if it's easy for experienced developers to make serious mistakes that are hard to detect. Given that PHP is frequently internet facing that has the potential to end very badly.
@@depafrom5277 I hate to break it to you but PHP is especially bad and in ways that are easy to stumble into. I have yet to see a foot-gun free language but PHP could open a gun shop and not sell out for a long time.
@@depafrom5277 I mean... kinda but to different extents. It's very clear some languages are more robust and predictable at glances, and some aren't. Python, javascript, PHP... great languages, but it's no C# or Java. There could potentially be a LOT of bugs in your code and you just don't know, because the control flow doesn't hit there and these super dynamic languages don't care until they execute it.
Honestly, the only thing that makes me want to use something other than PHP by now are generics and function-types. PHP even has fiber-based concurrency now - it's honestly pretty decent. My favorite language is still Scala, though (even though macros/reflection is a hassle) - have yet to see a better type-system in a productive language (i.e. not Coq or Agda).
What do you mean by function-types? PHP has first-class functions, and functions can be typed using the “callable” keyword. (If I’ve misunderstood I’m curious what you mean! 😊)
@rcnhsuailsnyfiue2 Oh, sorry. I meant being able to type-hint both the parameter-types and return-type of a function taken as parameter or returned from a higher-level function (or stored in a typed field in a class/trait). Not quite the same thing as generic types - which are technically type-constructors.
The big advantage of a variadic argument in PHP is that you can specify the type. PHP doesn't natively have generics or typed arrays (you have to use a third party static analysis product for those), but you can do something similar with a typed variadic argument.
Yep, I remember the good ol' days of slinging PHP 5.4. It's great that the language has improved, and having used Rails and Laravel, I think Laravel is a better framework, and PHP is faster than Ruby too :)
As much as I love Ruby, and by extension Ruby on Rails. Laravel+PHP has been upgrading so quickly, and without the DHH nonsense. It's hard because I still like Ruby's flexibility (and syntactic sugar/flexibility) more, but might need to stick to PHP for developer adoptability.
I'm extremely cautious about personality-driven projects as a whole. Rail have DHH, Laravel has Taylor Otwell (he drives a lambo. oohhhh), Svelte has Rich Harris and so on. Sometimes the end product is really good, but I'm always skeptical about what made these so big: the product itself or the personality behind it.
Strict typing and static analysis with PHPStan are my daily bread. I can't live longer without that. Variadic functionaly (spread operator with named arguments) are fantastic.
I had to use php in 2017 and really enjoyed working on our newer projects that used version 7... I think my gripes were exclusively related to tasks on the old version 5 projects. From what I remember, php7+ isn't backward compatible with 5.x, so there was no cheap way to start upgrading those php5 sites. If it wasn't for that, I'm 99% sure I'd still be open to php jobs.
The biggest issue with upgrading is the libraries. Our company had about 10 loc which needed changing in total if excluding libraries when that upgrading was done.
Yeah true on the libraries and I will check out Rector, ty! Thinking about it more, part of my situation was that the old projects were just awful spaghetti no one wanted to modernize because it would mean having to unravel the worst if/else and switch ladders known to man to do anything new with them :P
Happy Birthday Beast Kill =] Also - I know nothing about Programming beyond messing around with Unity and C# - But your content is always entertaining Appreciate you inspiring me to learn ❤
Php of lamp stack, gave thousands of startups without budget to pay windows license job opportunities. Those people who say php is valueless should check their brain.
sadly these arrow functions only work for one-liners, for multiple line function, uses the normal one, arrow function gets scoped values, but normal funcitons must _use_ "use" keyword say: function () use ($outsideVariable) {...}
Been using php since like 2001 and it absolutely has come a long, long way in that time. I agree with the initial premise, most folks who hate it/believe it's dead haven't even looked at it in a decade or more. Writing shitty php code in 2010 was mandatory, now it's on you as a developer if you keep writing hacky code.
So in the video only syntax improvements have been shown I never complained about. It's true that I didn't worked with PHP for a long time, but the video didn't address any of the points I don't like about PHP. Like needing to write
@@Duconi embedding php in html hasn’t been the norm in a long time, most “real” sites made in php now are php first and are loading template files. Include_once() let’s you include a file only if it hasn’t been included already, but again you’d often load them as far of a framework. You can write cli apps in php very easily. Phpunit has been around for a long time for unit testing.
@@ItsDan123 Okay, so it seems that PHP now provides some of the things that you can expect from a programming language. But has it an advantage over other languages? Everything you can do with PHP you can also do with TS, Java or Rust. So for a company that is building their own online shop for example. Why should they use PHP for that? I would have used TypeScript, as you need JS anyway to do dynamic parts in the browser, so by doing everything with it avoids switching between languages and I can reuse components. Also nuxt for example can fully implement the JAM stack with SSG or SSR and API endpoints.
I wrote projects in Java, Node, .NET and PHP. And Java and PHP were the only languages that I had fun creating stuff. The only thing that I miss from PHP is to be able to declare the same function and constructor multiple times with different arguments.
In Java that's method overloading, handled by the compiler. But the PHP compiler doesn't know the types of variables so it would have to be handled at runtime which would make it double (or multiple) dispatch.
You can get quite close to extension methods with traits with little effort but I agree it's not the same and I also agree with your other points. However all in all it's a decent language.
@@FlaviusAspra I meant extension methods for all types even primitives which PHP unfortunately doesn't support. It has an edge over TypeScript though, in that the type system is nominal. This is actually why I'm trying to switch to C# for a while now as it doesn't have any of these problems.
You can declare and check generics with Psalm, and the result is comparable to Java's type-erasure generics. C#'s reified generics are different still but few people really understand the difference between Java and C# generics anyways.
Wow thanks for this video. Great to bust the stereotype and congrats to the language developer for genuinely making it excellent. It definitely feels like something in between python and C# now. Which is a massive improvement.
about variadic arguments: php has still no typed arrays, so to make a type array in a typehint you use a typehint in combination with variadic to make a typed array.
Yes, probably not good for a big array though because I think you're making the runtime type checker go through and check every member of the array whenever you pass it around. For a big array just keep it as an array, declare the type in the docblocks, and rely on a static type checking tool.
My problems with PHP aren't features (though as a Gopher now, I actually find havinf tons of language features to be annoying). My problems are the stdlib being an absolute mess with inconsistent APIs and weird tech debt that's never getting fix, the garbage ecosystem full of projects from people that either try to emulate popular packages (like Doctrine emulating Hibernate poorly) or people who have no idea how to write a half decent API, the dev tooling is a hot mess, and worst of all, most jobs in it are absolutely awful tedious garbage. The language had enough features when 7 hit, the ecosystem has just never gotten better and the amount of _good_ php jobs has shrunk drastically while stuff like WordPress has artificially propped the language up. I will never go back to that hot mess of an ecosystem, Go is just as fast for prototyping with pretty much none of the downsides.
PHP was originally called PHP/FI, and PHP was an acronym for "personal home page." Poor Rasmus created it to implement a single project and expected it to be replaced by something better almost immediately. Instead, we only got commercial/proprietary implementations of basically the same model: ColdFusion and Active Server Pages and thirty years later we are still using PHP, albeit a highly evolved version of it. MySQL was a very similar story - never expected or intended to live forever but rather to be just good enough to implement a particular project because msql was moving a little too slow, despite costing actual money.
I can never forgive Lua for this either. Well, Lua does call them "tables" and not "arrays", but the first time I read up on it, I was like "oh yeah, that's an array", because the first thing the tutorial says is that the default definition of a table is identical to an array. Then I tried indexing into someone else's table and found out THAT'S NOT AN ARRAY. THAT is a linked list of structs of unions that is MASQUERADING as an array, and I HATE EVERYTHING RIGHT NOW.
@@hugochavez6170 No kidding! I love me a nice: $array = [1,2,3,4,5]; foreach ($array as $item) { echo $item; } v/ No possibility of an off by one v/ Short It's a lot more complicated than that in most other languages, PHP spoils us
I find one key use for ...$args; when you have a function that will call other functions passing those args, which might vary depending upon an argument. e.g. a function which will return the output from one function which has been wrapped in something else.
PHP looks great now. Everything is so C#-ish, and that's awesome! I'd love to see Traits in C#. The new "default interface methods" in C# is just weird to me, it's kinda like a Trait but not really.
Рік тому+3
Noone tell Prime that true and false are also types 🤫 But yeah PHP is actually quite decent now, unfortunately we're probably never going to get generic types 😞
I often use variadic arguments for deprecation of arguments. It allows me to keep backwards compatibility while re-using the function with different parameters. And then check, if the old args are passed in, throw a deprecation notice. If the new ones are passed in, all good! Then add a PHPDoc with the old arguments with a deprecation, and new arguments, to continue IDE autocompletes.
I use PHP at work and we are fine with it. I would love if to drop the dollar sign ($) for variables and the arrow notation (->) to access class attributes.
So, what I see is that PHP has adopted features that I'm pretty sure were first added in Hacklang, and the Hacklang team was, in large part, an ex-C# and ex-F# team hired away from Microsoft (the thing about PHP being influenced by Hacklang is conjecture, the thing about Hacklang being half-Microsoft is a fact).
Don"t know which language did it first but things like variable assigning through switch got to me first in Kotlin and it is really nice. I'm glad that PHP has done some really nice steps forward 👍
12:55 I never used PHP, so for me, most of this video is "Wow, look at all these things that PHP didn't have." But that is genuinely amazing. I had the same expression as Prime.
But Prime, I've been telling you that php is better than js. Not finished watching, but in addition to the language: the php ecosystem is not as wacky. It still has its quirks, but they're not that horrible. Also, it's fast. Quite fast. All in all, I do think that the latest push in php for more typing is just ground work for a bigger comeback in php 9 or 10. Oh and one last thing: the php community needs to put WordPress up there as the posterboy of how to NOT write code. Php professionals know that, we all know it, it needs to be done. My biggest wish from php are generics.
I've benchmarked C# vs Java vs Scala vs PHP in a blogpost. Surprisingly, PHP was the fastest calculating n factorial with bigint libraries and saving that to a hard drive. By far. By more than x100 times.
It’s time to put an end to WordPress, honestly just put us all out of it’s misery. I remember when Mullenweg forked B2, and WP jumped the shark completely within a few years. It went to shit as it became a CMS instead of a blogging platform, back when Joomla was “hot.” WordPress is software for zombies.
@@MDMAviation After initial interpretation, its basically just c or assembly level performance unlike other languages with much much bigger VM overheads. Im shocked to here x100 times though.
I primarily work in WordPress and am well aware that it's a disaster. But, would you be able to give an overview of the biggest issues that you see with it? Or point to a resource that already has done so?
I have much regret to inform you all that Beastco, commonly referred to as Big Dick Daddy from Cincinnati, wishes to thank everyone but his YT account contains his real name and he refuses to use it with all of you degens due to your degenerate behavior
Wat
same, thats why I work hard to stay anonymous
he deserves it
Understandable
is this a reupload? I am completely lost on what you are saying. Can someone explain to me like I am 5?
Thank you for watching Prime ❤ You're the best.
And thanks for the video❤
Subbed, Aaron 🎉❤
@@JeremyAndersonBoise Thank you! I won't let you down 🫡
Did not realize this was the creator of the video Prime is watching, thought this was just a nice guy thanking me for watching Prime and telling me I was the best 😂
This was a great overview of the language itself, maybe you should also cover the community/libraries as they are a big part of choosing a language
Fun fact: PHP’s creator Rasmus Lerdorf is from the tiny country of Denmark. Who else is from Denmark, you ask? Well, the creator of TypeScript - and C#. And the creator of Ruby on Rails. And Google’s V8 engine which finally made JavaScript fast enough to be taken seriously as a contender on the server side - also built in Denmark.
Edit: Also the creator of C++.
All this (and more, but this is getting long) from a tiny country of 5M people living mostly off LEGOs and bacon.
Genius people
You forgot c++, which was also created by a Dane
@@srenpeterkaagaardthuesen4206 I did - apologies to Bjarne Stroustrup!
@@srenpeterkaagaardthuesen4206 isn't he Swedish?
Bacon? Not speck? 😉
Nothing wrong with PHP. I've made a career out of fixing PHP apps and with the exception of huge enterprises with millions of users, PHP is more than fast enough for 99% of scenarios.
I used to worked on a decade old php 4. codebase that 1.5GB in size without any external libs or packages. With all the SQL in PHP in JS in HTML glory
In local machine it take 3 minutes to a single button to load, and a use case is like 15-16 button. It took hour just to see the error.
And somehow on production it still land in ms
After that codebase i dont believe there is any language that is not "fast enough"
PHP works fine for Facebook and Spotify, just to mention 2 with million of users.
I love Dart, Go, Zig and working on interesting projects in my free time. But PHP pays my taxes))
@@Netz0 does facebook still use php?
“nothing wrong with php”
“I’ve made career out of fixing PHP apps”
okaaaay….
Some things he didn't mention:
- mysql calls can be made asynchronously.
- cURL can be asynchronous.
- class preloading can be used to significantly reduce process boot up time.
- close to complete implementation of object oriented programming from other larger languages
- two technologies exist which can cross-compile PHP to C++
are you talking about hiphop for that last one? how does the c++ access php superglobals?
@@Runeite51 no, but that's a third option i didn't think about.
Sorry, i have not used it yet so i don't know details on how they work, only that they exist and look viable.
@@neptronix what did you have in mind then? I’m aware of phpwasm/WebAssembly and FFI, but not sure what you would be referring to otherwise
@@rcnhsuailsnyfiue2 I dunno, i'm aware of this stuff just in case i ever need it. Right now PHP is plenty fast but i wanted to know if a 10x speedup was possible if i ever need it.
Seems feasible
@@rcnhsuailsnyfiue2 yeah I've been on the prowl for something to let me code in C + access to php when needed. Only viable option I've come to find is to build a php extension (FFI has weird limitations and calling exec() to many times is expensive and awkward, and I don't want to invoke script tags to do it)
I started learning PHP during my apprenticeship and the teachers still gave us the 7.3 executable (yes it wasn't that long ago). I read the changelog when php 8 was getting ready to release and my mind was blown when I discovered pattern matching.
at least it wasn't PHP5. PHP 7.3 is already nice enough if you have type hinting through PHPDoc.
You don't understand what people experienced if you started with PHP 7.
The last time i moved apartments I throw out my php 4 handbook ;-)
php7 is very good and modern, we did it in the hard way when we're at 5, it was the dark age
@@TheDuckPoxI'm using PHP 5.4 rn and it's torgure
Seeing your mind get blown by traits alone made my day. Thank you.
Traits have been around since PHP 5.4. So even if you only get to work on legacy code, chances are you can still use Traits and I love them.
Array destructuring was possibel even pre 7.1 via the list() function. It just got a bit more convenient to write. Some of lists()s downsides still exist.
PHPs improvement is slooooow, but as we Germans say "Gut Ding will Weile haben".
Or in other words "Good things take time".
The benefits of PSR standards are clearly evident too. Recently upgraded Slim 3 to 4 and VS Code is now able to pick up the framework's types much better due to those standards.
@@OzzyTheGiant I don't agree with all of the PSR stuff, but I'd rather have it than not.
@@OzzyTheGiant You can also use a static analysis tool like psalm which really saves your ass by checking types (and other things) too
They are not really traits though, they are mixins
@@marcusrehn6915 Traits only add a bunch of properties and methods (even static ones) to a class.
The trait itself does not have its own state. As far as I know. It is more akin to an Include but for definitions inside a class. You can access a property of the using class from within the trait because the properties of the trait are just copied to the using class and thus become properties of the class itself.
Semanticswise I will not argue. Arguing is pointless, since Mixins and Traits solve the same problem in very similar ways. Different Languages implement different concepts under different names.
If anyone is interested in understanding how massive the PHP performance optimization was at version 7, there's this talk at ua-cam.com/video/fYTKm2oUzAg/v-deo.html where the PHP creator, AKA Rasmus Lerdorf, goes into some of the points that made PHP 7 so much faster. At some point, he explains how upgrading from PHP 5 to 7 would reduce the CO2 emissions from servers by 7.5 BILLION kg yearly, which is pretty insane.
lol that's like measuring distances in finge.... oh.
OH.
Co2 is good for plants bro
Only to a certain extent, CO2 is bad for plants at night as they need to breathe oxygen when not photosynthesizing@@BrandonWilliams-wf6hg
oxygen isn't. we should get rid of oxygen
My first big language was PHP, so it has a special place in my heart. I can't believe all the great improvements in it since I left it a decade ago. Wow. Very cool. Great video.
In my non scientific empirical research for the last 10 years 10% of people who hates PHP have actually used it & hates it for valid reasons and 90% hates it because hating it is "cool" but can't provide a single reason as to why they hate it, or they use it out of "scope". As a general programming language it sucks, for web it is more than capable for 99% of the devs for it's intended usecase, it is a great "get shit done" language, but some people take it way to seriously ;)
And this is one of the big misconceptions. PHP can be run as CLI for decades. It does need a web server to run, and it can be certainly used for non web things just like python, being faster as well for the same tasks.
I'm just hating on all weakly or dynamically typed languages. From PHP, through JS, TS, Ruby, to Python.
I had to use it daily for 15 years to hate it.
you cannot use variables in functions with ease, it's slow, it's error messages were ugly, it's don't have any keywords for defining variables, there is no object literals or structs, you have to write associative arrays, it's support of utf-8 is very low and a lot of versions has various security vulnerabilities, also wordpress and it's plugin system also sucks, when you don't update your plugin you could easily hacked by someone other. That reasons are a few just i remembered right now.
@@haliszekeriyaozkok4851
>also wordpress and it's plugin system also sucks, when you don't update your plugin you could easily hacked by someone.
Ok, so that is wordpress's issue. Not PHP.
This is the BEST reaction video ever! I'm a php programmer. I'm just lol my ass off by your reactions! You've got to make a php side project!
Speaking as a recent convert myself, PHP is incredibly productive. And with Laravel + Inertia or Livewire I have never moved faster in the full stack.
did you actually learn Inertia AND Livewire? Because I'm over here struggling to even get started with one of them. Not because it's particularly hard but because I've been programming for ten years and my resistance to learning anything new is annoyingly high
@@holonaut I did! Inertia is pretty seamless. You bring React or Vue and just use it. Laravel manages state and routing for you server side. Livewire has a steeper learning curve since you can’t lean on existing knowledge, but once you get it you can move incredibly quickly in the full stack, even faster than inertia.
We should have Primeagen code a wepapp in a PHP for a video.
@@filthyfrankblack4067 hahaha I would watch ngl
@@holonautLaravel + Inertia + Vue here. Well if you know Laravel, using Inertia is a breeze. You can skip API code and write just like for normal views. It's wonderful. 👍
I worked with PHP/JS/TS/GO/Dart/Python, and php is still my goto language for new web projects.
it's the most "it just works" language out there, no compilation, great package managers, decent speed, ...
If you need more performance, just slap Swoole in
@@khangle6872 PHP is thinked for concurrent requests, not for a unique process that has multiple threads. It could be useful if you use something like websockets where you have only one process that runs a server, but not for just plain websites with maybe some ajax.
@@khangle6872 PHP is thinked for concurrent requests, not for a unique process that has multiple threads. It could be useful if you use something like websockets where you have only one process that runs a server, but not for just plain websites with maybe some ajax.
There are a lot of design decisions outside the language and interpreter that can be made to improve performance, in most cases, but Swoole does look compelling!
@@khangle6872PHP + Swoole is basically the poor man's Go and it fuckin' rocks. I love throwing little bits of coroutines on legacy apps.
Dude I've been programming for almost 25 years now, and I've only just discovered you. I must say I've gotten a big boost because AI also makes my programming life so much easier (especially with other languages that I now feel very comfortable to just dabble with for an afternoon), but this is so good. You get me hyped for things I've been doing for years. This is quite refreshing after watching thousands of tutorials.
Disclaimer: I'm not into gaming/discord as I would lose myself and my sanity, so no twitch and all it's goodness. Glad you also share it on UA-cam.
PHP literally stole all the good junk from every language right now and just jammed it into PHP 8. Absolutely fantastic to work with compared to Python or JS/TS.
Unfortunately, I'm looking to use a default language that has more than just back end as its use case, so I'll probably be using Go, Kotlin or C# for that, as they all compile AOT and are easier to deploy rather than having a fat Docker container. PHP though, is definitely the most optimized language for straight up back-end web dev.
Compared to python, wut? Half of these features are straight from python.
Php is easier to deploy on server.
@@hmb8801 *on Apache
I just watched this and was thinking about how kotlin had all this already in like 2015, also if you work with php chances are the version will not be 7/8....
That's exactly what php is: a pile of stolen, inconsistent junk from each year's favorite thing. What's good in it is stolen merit.
PHP used to suck because there was nothing worse on the web apart from ASP Net maybe. Nowadays, in the world where react server components exist even PHP5 doesn't look too bad. I mean, if you just render html server-side and don't go super fancy with all these modern restful microservices, php is actually great.
My argument against server side rendering exactly: if I wanted to do that, I'd be back in PHP
I want cached client code and lightweight server execution damnit
you have htmx to make modern apps combined with php is super powerful
I love variadic arguments. I love them so much, I implemented a polymorphic function using variadic arguments in MSVC's particular flavor of C . . . and now I hate variadic arguments, I hate my life, I hate everything, may God have mercy on the soul of whoever decided that MSVC was not going to support ISO C and thereby leading me down the wrong path for a solid 3 hours of constant swearing. May God have mercy on his soul, because I might not.
I agree. I somehow hate C varargs even more than I hate C++ variadic templates
It's baffling how bad C support is on Windows
@@amrojjeh honestly, just use wsl if you want to do C on Windows. Go to the command line, run "wsl --install", reboot, run "wsl" again, and voila! a POSIX-compliant bash shell running in a Ubuntu virtual machine that you can then install GCC on. Because yeah, Windows support for C is abysmal, and trying to dance around the differences between MSVC C and ISO C17 is massively confusing for a new programmer like me.
Im so used to bash shell scripts that i am very used to variable length arguments to programs or functions. It can be useful for various reasons.
@@l3lackoutsMedia hey, I don't mind variable length argument lists, I just particularly hate MSVC's particularly garbage syntax for it. ISO C's syntax is already pretty mid, and MSCV's particular "improvements" make me want to throttle someone.
I appreciate the work of engineers who were fixing PHP over all those years
I'm surprisingly impressed. Kinda crazy how much 'convergence' there is across languages, even the ones you least expect.
Long story short: they all copy each other
Just to be clear. PHP traits are not like Rust traits, they are more what you tend to call Mixins in other languages.
Yes, they are basically bundles of code.
traits are amazing in PHP, love them
Traits are complete bullshit... they can access props of classes and other traits. It makes complete mess. That's why I hate Laravel. And that's one of many reasons why I quit from PHP
@@oliverfoxi Sounds like a code standard issue if that's a problem you had. Just don't do stupid shit like that.
@@oliverfoxiPHP-Traits are just a fancy copy-paste. Might be useful for some helper functions here and there, especially in unit tests, but for "regular" use, use them rarely.
Watching this has made me feel so much better about being forced to learn PHP for my Web Dev class. It looks like I could actually enjoy writing some PHP. Thank you Aaron and Prime.
P.S. Happy Birthday Beastco!
I do miss the LAMP stack + jQuery days. Simpler times. This looks very cool.
Yeah, when you didn't need 16GB of Ram just to browse the web, this was nice.
I remember writing PHP code directly on the prod server with WinSCP... the nostalgia
Notepad++ with the FTP plugin
Miss the good old days of editing the file in notepad while using filezilla
"php is better than JS" what i've been telling people for years but eh it's not cool
my heart when the underdog wins the special olympics
It's like saying dog crap is better than cat crap. Same difference hahaha
Let's go PHP, up to date with the needs of the modern programming industry!! Also, Happy Birthday Beastco!!
PHP progression looks a lot like C# progression over the years. Might have to give PHP a go
They want to be PHP#
It's pretty fun to use, I'd recommend trying it with Hotwire Turbo or HTMX.
@@oddikaro8236 php wants to be Java. C sharp wanted to be Java so much it stole the entire syntax.
@@TheRafark if C# stole java's entire syntax it would be as horrible and outdated as java.
The point about having more information at a language level makes me think that the modern model for writing a new trendy programming language is "abstract away from the computer but don't abstract away from what the computer is doing"
I want to be able to read and understand my code at a human level but it's being written for a computer to execute. as much as a garbage collector can take care of it, it's important to know as programmers that we are telling a *computer* to do the stuff and languages can abstract away as much as they want but it's kinda useful for us to know when we're talking to the computer vs talking to the next person who's been hired to maintain our codebase. sometimes I prefer added verbosity over syntactic sugar cos I actually get a sense of what is going on
That is one of the reasons why I don't mind Java syntax.
@@CottidaeSEA I find the inference from Kotlin to be a good middle compromise.
@@Pictor13 Can you give an example? If you mean dynamic type assignment for a variable, then that's something which exists in Java as well through var.
It always cracks me up to see PHP haters get BTFO'd in real time. Also, regarding performance, PHP running on top of Swoole is actually fast af. You should look into it.
php swoole is used in Asia for tens of millions of concurent users, western dev world just looks for latest flashy stuff and still thinks of PHP of the early 2000s 😆
@@makoceans which means developing in PHP will turn you into a communist. NO THANKS! 🫡
I have been using Swoole for a few years now and its pretty damn good.
Im currently writing a new project in php 8.2 with Symfony, it's fine. Pretty much on the level as other languages, just a bit less elegant in many places.
Why not laravel?
@@coldestbeerbecause symfony has better practices and laravel is just using symfony components.
@@coldestbeer laravel is for non-programmers, its too much magic under the hood, for people starting out is amazing, they have no clue their ORM is going to pull X numbers of records just to count them in-memory and display that number, on EVERY REQUEST, so yeah, localhost with 10 records = yay, produciton with 10k records = ugh; but most laravels people just code, deliver, get paid and bye bye, they dont know or care.
@@coldestbeer Mostly because I've been using Twig and Swiftmailer for years so Symfony was the natural choice. Also Symfonycasts makes it very easy to get started.
less elegant ? Can you give some examples ? I specifically like PHP because (and maybe I'm too biased) the syntax it's the best for me, makes the most sense. Not too cryptic, not too verbose, just the right amount of practical and descriptive.
A few days ago, when the php video came out, I was about to go on a mission to post the link to this video as a comment on each of your new videos. I'm glad this video reached you without me having to do anything. To the person who shared this video, thank you, you're a champ. ❤
Types contextualize variables. Variables don't contextualize types.
We read code left to right.
Type before variable.
Happy birthday beastco.
PHP having traits makes me unreasonably happy
Traits were introduced in PHP 5.4, 11 years ago
@@holonaut Well, most people who didn't specialize in PHP but had to deal with enterprise got stuck on < 5.3, due to blocking support for the deprecated but still in use primal Zend. And anybody that didn't need PHP in the first place was either an asp runner or just hopped on the train to use Node.
Went back to PHP when version 8 was released. One of my favorites now.
I'd like to add. If you're processing 50000 requests, it's more of an architecture issue than a language issue.
Arguably, if you’re processing >50k req/s it’s an everything issue. You’ll want to distribute the load; cache the crap out of any data those requests need as you definitely don’t want to do any disk or network I/O; a nice trick is to strip away the frameworks and language runtimes entirely and go straight nginx low level configs; you’ll even want to tune your network stack/drivers just so you’re not leaving any performance on the table.
@@JensRoland Could you illuminate me on where can i learn all this stuff?
@@enriquejosemunozavellan5517 the internet
yeah, php-fpm along with some autoscaling nodes behind a load balancer can easily handle 50k req/s if you have the cash
Unless you’re using Elixir (Erlang), than you have another 49.950.000 request to go, before architecture becomes an issue.
HBD Beastco 🎉
So many other awesome things that weren't mentioned in this video as well.
Composer is probably one of the best package managers I've ever used.
We have Fibers built into the language (though they are a little unwieldy right now without specific libraries).
Using Psalm or PHPStan, you can have compile time type checking with all sorts of more advanced types (in comments) such as generics.
You can also destructure string-keyed arrays.
The ecosystem has a standards body that allows us to utilize any implementation of certain things (like caching or logging) interchangeably. Need Async logs? There's a package for that. Needs logs sending to XYZ? There's a package for that.
And there is just soooo much more great things to say about the PHP ecosystem.
Problem is a lot of php codebases (that I've seen anyway) were made in old versions of php, which does suck. Even if new php is better, I'd still rather use a lot of other languages instead for new stuff
100% this, never going back to php it is 99% not php 7/8 with some hiodeous dependency on some shity wordpress instalation with a custom hacked plugin that a developer once tailormade in 5 years and left the company 10 years ago with 0 documentation and obfuscated code that was never touched/refactored or corrected(bugged from day 1 when wordpress was upgraded from 4 to 5)
I started during the PHP 5.6-era (I was 14 back then) and started taking it serious around PHP 7.0 (I was 16 or so) so I never understood the hate against PHP.
Mainly because each time tried to hate on it, their arguments could literally be debunked with: "That's not an issue", either because PHP added that or because it an issue was so, so, so specific that you'd have to actually *try* to purposefully trigger that "issue" rather than stumbling upon it.
Nowadays I mainly use TypeScript with Deno but that's because it has async/await (which PHP sadly still doesn't have) and allows me to create stuff like Discord bots without scuffed hacks like AmPHP or ReactPHP.
For the async/await, couldn't that be done with Swoole ? It's an official server which can do sync, async, fiber and I think everything inbetween. Haven't used it, but it looks interesting, I can't wait to try it out.
@@Winnetou17 While I think Swoole is a step in the right direction, it suffers the same issues as AmPHP and ReactPHP which make it feel more like a "hack" rather than a "solution".
Additionally, it lacks a form of "await" so I have to pass a callback to an async handler (eg. `Swoole\Async::read($file, function($res){})`) rather than just say `$content = await Swoole\Async::read()`.
There was a library called "Swoole Futures" which added this syntactic sugar which does come very close but not quite close enough.
@@FinlayDaG33k Oh, ok.
My first website with a backend was written in PHP. It has a special place in my heart ❤
I was fortunate enough to do a stint with a company building their web-site with C#. I ended up modeling my PHP framework around that back in 2009. That saved me a lot of pain. PHP lets you code like a buffoon. But has always given the tools to write clean code if you put in the effort. Since PHP 5.2 didn't have types, so I built my framework around classes because I could at least ensure you weren't setting and getting magic properties by overloading __get and __set with a code base class that all classes extended from.
The problem with PHP is that it's jam packed with foot-guns. It can perform great and have lots of sugar but if it's easy for experienced developers to make serious mistakes that are hard to detect. Given that PHP is frequently internet facing that has the potential to end very badly.
Well, thats true for all languages.
@@depafrom5277 I hate to break it to you but PHP is especially bad and in ways that are easy to stumble into. I have yet to see a foot-gun free language but PHP could open a gun shop and not sell out for a long time.
@@depafrom5277plenty of languages are safe and make bugs harder to write. The trade-off is normally that everything else is harder too.
@@depafrom5277 I mean... kinda but to different extents. It's very clear some languages are more robust and predictable at glances, and some aren't. Python, javascript, PHP... great languages, but it's no C# or Java. There could potentially be a LOT of bugs in your code and you just don't know, because the control flow doesn't hit there and these super dynamic languages don't care until they execute it.
PHP has removed a lot of those foot guns over the years now. A lot a lot of those things just do not exist any more.
PHP 8 is modern PHP.
It is NOT your grandpa's PHP folks! 😊
Honestly, the only thing that makes me want to use something other than PHP by now are generics and function-types. PHP even has fiber-based concurrency now - it's honestly pretty decent. My favorite language is still Scala, though (even though macros/reflection is a hassle) - have yet to see a better type-system in a productive language (i.e. not Coq or Agda).
You can add generics through a transpile step at the very least. Not perfect, but it works.
What do you mean by function-types? PHP has first-class functions, and functions can be typed using the “callable” keyword. (If I’ve misunderstood I’m curious what you mean! 😊)
@rcnhsuailsnyfiue2 Oh, sorry. I meant being able to type-hint both the parameter-types and return-type of a function taken as parameter or returned from a higher-level function (or stored in a typed field in a class/trait).
Not quite the same thing as generic types - which are technically type-constructors.
The big advantage of a variadic argument in PHP is that you can specify the type. PHP doesn't natively have generics or typed arrays (you have to use a third party static analysis product for those), but you can do something similar with a typed variadic argument.
That SensitiveParameter is lowkey super awesome and is what I want in my project
Yep, I remember the good ol' days of slinging PHP 5.4. It's great that the language has improved, and having used Rails and Laravel, I think Laravel is a better framework, and PHP is faster than Ruby too :)
Aaron's videos for PlanetScale are really good as well, he explains things very well with a lot of nuance.
yeah I actually learned some new things from his videos
❤ super glad to hear that
Everybody loves pattern matching for switch statements. It's so nice.
Prime always pretending like he’s not a js/ts soy dev like the rest of us
Edit typo
larping
lul
As much as I love Ruby, and by extension Ruby on Rails. Laravel+PHP has been upgrading so quickly, and without the DHH nonsense.
It's hard because I still like Ruby's flexibility (and syntactic sugar/flexibility) more, but might need to stick to PHP for developer adoptability.
I'm extremely cautious about personality-driven projects as a whole.
Rail have DHH, Laravel has Taylor Otwell (he drives a lambo. oohhhh), Svelte has Rich Harris and so on. Sometimes the end product is really good, but I'm always skeptical about what made these so big: the product itself or the personality behind it.
Strict typing and static analysis with PHPStan are my daily bread. I can't live longer without that. Variadic functionaly (spread operator with named arguments) are fantastic.
PHP: Oh you studied me 10 years ago?
😎 Allow me to reintroduce myself.
🙌🏾👏🏾🙌🏾👏🏾🙌🏾👏🏾🙌🏾👏🏾🙌🏾👏🏾🙌🏾
Am glad you added in the end that go compiles really fast because i was looking at PHP features and saying okay comeback to me when you can bin.
I had to use php in 2017 and really enjoyed working on our newer projects that used version 7... I think my gripes were exclusively related to tasks on the old version 5 projects.
From what I remember, php7+ isn't backward compatible with 5.x, so there was no cheap way to start upgrading those php5 sites. If it wasn't for that, I'm 99% sure I'd still be open to php jobs.
The biggest issue with upgrading is the libraries. Our company had about 10 loc which needed changing in total if excluding libraries when that upgrading was done.
Rector can help with automatic upgrade.
Yeah true on the libraries and I will check out Rector, ty! Thinking about it more, part of my situation was that the old projects were just awful spaghetti no one wanted to modernize because it would mean having to unravel the worst if/else and switch ladders known to man to do anything new with them :P
@@wforbes87 yeah, we have dedicated analytics to do that if/else and other logic analysis for ongoing refactoring.
Happy Birthday beastco! Stop spamming C# danggit! xD
so this is c# with a $ all over the place...
the fact most of the web is in javascript right now make me retch every time I remember it. This must stop. Let's come back to sanity once again
PHP is ML future! ChatPHP is coming to disrupt the market!
This guy is the Tony Hinchcliffe of programming and its fucking awesome.
My mind is blown… no comment on the 420% increase in performance
Java devs skipped that part 😅😅
Happy Birthday Beast Kill =]
Also - I know nothing about Programming beyond messing around with Unity and C# - But your content is always entertaining
Appreciate you inspiring me to learn
❤
happy birthday beastco
Would have been nice to hear more comparisons to modern Java. The constructor types are very similar to record classes in Java.
Java is corporate suckness shit. Thats the comparison.
Except records are readonly data structs and not classes, which I honestly prefer. The distinction is better.
Didnt C# add record types first?
Happy birthday beastco
Php of lamp stack, gave thousands of startups without budget to pay windows license job opportunities. Those people who say php is valueless should check their brain.
I used to love PHP... I don't know if I am ready to love again.
appreciated coming from an official PHP member ;-) yes variadic can bite you (even more so in C/C++)
I had the same reaction as our mustache guy here when I watched it the first time
9:43 I like the fn in the beginning. It shows use of arrow function with a glance when you are scrolling code file.
sadly these arrow functions only work for one-liners, for multiple line function, uses the normal one, arrow function gets scoped values, but normal funcitons must _use_ "use" keyword say:
function () use ($outsideVariable) {...}
Been using php since like 2001 and it absolutely has come a long, long way in that time. I agree with the initial premise, most folks who hate it/believe it's dead haven't even looked at it in a decade or more. Writing shitty php code in 2010 was mandatory, now it's on you as a developer if you keep writing hacky code.
So in the video only syntax improvements have been shown I never complained about. It's true that I didn't worked with PHP for a long time, but the video didn't address any of the points I don't like about PHP. Like needing to write
@@Duconi embedding php in html hasn’t been the norm in a long time, most “real” sites made in php now are php first and are loading template files. Include_once() let’s you include a file only if it hasn’t been included already, but again you’d often load them as far of a framework. You can write cli apps in php very easily. Phpunit has been around for a long time for unit testing.
@@ItsDan123 Okay, so it seems that PHP now provides some of the things that you can expect from a programming language. But has it an advantage over other languages? Everything you can do with PHP you can also do with TS, Java or Rust. So for a company that is building their own online shop for example. Why should they use PHP for that?
I would have used TypeScript, as you need JS anyway to do dynamic parts in the browser, so by doing everything with it avoids switching between languages and I can reuse components. Also nuxt for example can fully implement the JAM stack with SSG or SSR and API endpoints.
is it like fortran77 vs fortran90
People who know laravel are aware of the strength of PHP. He didn't even mention interfaces.
I wrote projects in Java, Node, .NET and PHP.
And Java and PHP were the only languages that I had fun creating stuff.
The only thing that I miss from PHP is to be able to declare the same function and constructor multiple times with different arguments.
That's called polymorphism
@@MDMAviation its called mehtod overloading, and btw @filipstudeny in c# you can do that too
Isn't the goal achievable with union types?
In Java that's method overloading, handled by the compiler. But the PHP compiler doesn't know the types of variables so it would have to be handled at runtime which would make it double (or multiple) dispatch.
I'm using PHP over 20 years now, and over that time it's developers added almost every thing that made it a better / mature language.
Lack of generics, distinction between arrays and hash maps and no extension methods kills it for me.
You can get quite close to extension methods with traits with little effort but I agree it's not the same and I also agree with your other points.
However all in all it's a decent language.
@@FlaviusAspra I meant extension methods for all types even primitives which PHP unfortunately doesn't support. It has an edge over TypeScript though, in that the type system is nominal. This is actually why I'm trying to switch to C# for a while now as it doesn't have any of these problems.
You can declare and check generics with Psalm, and the result is comparable to Java's type-erasure generics.
C#'s reified generics are different still but few people really understand the difference between Java and C# generics anyways.
Wow thanks for this video. Great to bust the stereotype and congrats to the language developer for genuinely making it excellent. It definitely feels like something in between python and C# now. Which is a massive improvement.
PHP is a lot like Apple Maps
about variadic arguments: php has still no typed arrays, so to make a type array in a typehint you use a typehint in combination with variadic to make a typed array.
Yes, probably not good for a big array though because I think you're making the runtime type checker go through and check every member of the array whenever you pass it around. For a big array just keep it as an array, declare the type in the docblocks, and rely on a static type checking tool.
My problems with PHP aren't features (though as a Gopher now, I actually find havinf tons of language features to be annoying). My problems are the stdlib being an absolute mess with inconsistent APIs and weird tech debt that's never getting fix, the garbage ecosystem full of projects from people that either try to emulate popular packages (like Doctrine emulating Hibernate poorly) or people who have no idea how to write a half decent API, the dev tooling is a hot mess, and worst of all, most jobs in it are absolutely awful tedious garbage.
The language had enough features when 7 hit, the ecosystem has just never gotten better and the amount of _good_ php jobs has shrunk drastically while stuff like WordPress has artificially propped the language up. I will never go back to that hot mess of an ecosystem, Go is just as fast for prototyping with pretty much none of the downsides.
It's still strange that the official PHP documentation has a comment section, and worse that the stdlib is so annoying it's actually necessary.
PHP was originally called PHP/FI, and PHP was an acronym for "personal home page." Poor Rasmus created it to implement a single project and expected it to be replaced by something better almost immediately. Instead, we only got commercial/proprietary implementations of basically the same model: ColdFusion and Active Server Pages and thirty years later we are still using PHP, albeit a highly evolved version of it. MySQL was a very similar story - never expected or intended to live forever but rather to be just good enough to implement a particular project because msql was moving a little too slow, despite costing actual money.
PHP calls its dictionaries/objects/maps “arrays” and therefore I can never forgive it
PHP doesn't call objects 'arrays' at all!
I can never forgive Lua for this either. Well, Lua does call them "tables" and not "arrays", but the first time I read up on it, I was like "oh yeah, that's an array", because the first thing the tutorial says is that the default definition of a table is identical to an array. Then I tried indexing into someone else's table and found out THAT'S NOT AN ARRAY. THAT is a linked list of structs of unions that is MASQUERADING as an array, and I HATE EVERYTHING RIGHT NOW.
@@mage3690 I love how an 'array' in PHP can very consistently provide the kind of data structure types that languages usually have 2-5 of..
If you use JSON, then you should not complain about PHP's arrays. 😊
@@hugochavez6170
No kidding!
I love me a nice:
$array = [1,2,3,4,5];
foreach ($array as $item) { echo $item; }
v/ No possibility of an off by one
v/ Short
It's a lot more complicated than that in most other languages, PHP spoils us
I find one key use for ...$args; when you have a function that will call other functions passing those args, which might vary depending upon an argument.
e.g. a function which will return the output from one function which has been wrapped in something else.
When you come back to your childhood neighborhood, and the fat girl with pimples is now Scarlett Johansson
PHP looks great now. Everything is so C#-ish, and that's awesome! I'd love to see Traits in C#. The new "default interface methods" in C# is just weird to me, it's kinda like a Trait but not really.
Noone tell Prime that true and false are also types 🤫
But yeah PHP is actually quite decent now, unfortunately we're probably never going to get generic types 😞
Аннотации + статический анализатор, не так удобно как в других языках но возможно
I often use variadic arguments for deprecation of arguments. It allows me to keep backwards compatibility while re-using the function with different parameters. And then check, if the old args are passed in, throw a deprecation notice. If the new ones are passed in, all good! Then add a PHPDoc with the old arguments with a deprecation, and new arguments, to continue IDE autocompletes.
I use PHP at work and we are fine with it. I would love if to drop the dollar sign ($) for variables and the arrow notation (->) to access class attributes.
Drop the $ sign? No thanks, it's one of the major reasons i use php. Stop devolving.
Without the $ sign, it's a constant
@@webdevnoob he forgot to mention const syntax in classes that before used to be the define function.
I thought the same about the dollar sign when I started working with PHP. I kind of like it now.
PHP sounds like an ointment for hemorrhoids - is that a use case? Giggity
I am on team PHP ❤
So, what I see is that PHP has adopted features that I'm pretty sure were first added in Hacklang, and the Hacklang team was, in large part, an ex-C# and ex-F# team hired away from Microsoft (the thing about PHP being influenced by Hacklang is conjecture, the thing about Hacklang being half-Microsoft is a fact).
Kotlin with dollars. Which is the main reason I do Kotlin. So... I'm in.
Don"t know which language did it first but things like variable assigning through switch got to me first in Kotlin and it is really nice. I'm glad that PHP has done some really nice steps forward 👍
most of this looks like C# syntax
12:55
I never used PHP, so for me, most of this video is "Wow, look at all these things that PHP didn't have."
But that is genuinely amazing. I had the same expression as Prime.
Have you seen how much PHP with Swoole increases HTTP request? +500%
Happy (belated) birthday, beastco !! :D
Sorry to have to tell you this, but based on your reaction to this PHP video, you might actually like C# now too.
doc, tell me its not true
They could add type inference so we could get intellisense from the IDE.
The only issue is if you get a php job you’ll be using php pre-5.3
Yeah, it is like loving the new Java features and then getting a job and working in Java 1
lmao that hasn't been true for years
Do you live in 2008?
Grow up
Like 7.4 at worst, you can also get job in COBOL, thats your responsibility if you take it, don't blame language but yourself ;]
Definitely the most "slap happy" video I've seen in a while.
But Prime, I've been telling you that php is better than js.
Not finished watching, but in addition to the language: the php ecosystem is not as wacky.
It still has its quirks, but they're not that horrible.
Also, it's fast. Quite fast.
All in all, I do think that the latest push in php for more typing is just ground work for a bigger comeback in php 9 or 10.
Oh and one last thing: the php community needs to put WordPress up there as the posterboy of how to NOT write code. Php professionals know that, we all know it, it needs to be done.
My biggest wish from php are generics.
I've benchmarked C# vs Java vs Scala vs PHP in a blogpost. Surprisingly, PHP was the fastest calculating n factorial with bigint libraries and saving that to a hard drive. By far. By more than x100 times.
To be fair, everything is better than JS 🤣
It’s time to put an end to WordPress, honestly just put us all out of it’s misery. I remember when Mullenweg forked B2, and WP jumped the shark completely within a few years. It went to shit as it became a CMS instead of a blogging platform, back when Joomla was “hot.” WordPress is software for zombies.
@@MDMAviation After initial interpretation, its basically just c or assembly level performance unlike other languages with much much bigger VM overheads. Im shocked to here x100 times though.
I primarily work in WordPress and am well aware that it's a disaster. But, would you be able to give an overview of the biggest issues that you see with it? Or point to a resource that already has done so?