okay, tell me what's bad about PHP 7.4+
protip: you can't
and you can't mention flaws of older versions
PS. you want hardcore difficulty: tell me flaws of PHP 8.2+
okay, tell me what's bad about PHP 7.4+
protip: you can't
and you can't mention flaws of older versions
PS. you want hardcore difficulty: tell me flaws of PHP 8.2+
No flaws. Just combine this amazing language with Laravel or Symfony and you mog all the JS code monkeys
just use Rust, it's memory safe
PHP has GC. it's memory safe as well
No multiple constructors
Haven't used it in about 10 years but I'm pretty sure you can just make a static function call it with :: syntax.
bros, why is he so smug?
why can't i mention flaws of old versions that remain in the new version
Half the tired classic complaints still apply, I don't get this meme.
I don't like that sequential and associative arrays use the same type. I don't like the inconsistencies and footguns in the standard library (in_array() needs strict: true, json_encode needs JSON_THROW_ON_ERROR, I still can't remember the parameter orders for array_map/array_filter). I don't like how underpowered the metaprogramming is compared to e.g. Python, it's either Java-style setters and getters or hard to follow YOLO-style __call and dynamic properties. I don't like that the gradual typing is primitive compared to other languages, I'm grateful for phpstan but I feel like I'm the only one in my team who actually understands it (unlike with TypeScript which is more polished all around) and variance becomes a mess. I don't like that I can't write multiple statements in fn closures and that I need to write out all the captures in function closures. I hate the behavior of yield from, what a shitshow.
t. writes greenfield PHP 8.2 full time
kys
kys
basedo
>footguns
Is "footguns" a new buzzword? I don't recall seeing it 5 years ago, now I see it everywhere. Or was a just not nooooooticing?
Could be that the noun form is new but shooting yourself in the foot with a programming language has been a popular meem for 40 years or so
https://www.stroustrup.com/quotes.html
Look at him go! 🙂 faster than every other language on the web.
coperino
I respect the elephant chuds, but it ain't for me.
> $
> Slower than python and ruby
> Types are just hints
Laravel looks cool thoughever
>slower than python and ruby
false
>types are just hints
just like on any other script lang
>C-like
>ugly
kys
> $
Yes. Problem?
Dollar signs are whatever
It's pretty fast, the language is less dynamic than those two and hence easier to optimize (but the execution model is different so that might affect things)
Type hints are enforced at runtime (but can't be very complex, no generics). phpstan can do offline typechecking with more complicated types but it's worse than the solutions for Python (and probably Ruby too but I haven't used that), let alone TypeScript
I hate Laravel, it makes code hard to understand and half the time it implicitly does the wrong thing
The ternary operator has the wrong associativity, the new operator has the wrong precedence, a couple of functions are secretly syntax, {} inside "" is hamstrung, fn and match can't contain statements, declare() is bizarre
It's ugly in the details
> $
you can go with define()
> Slower than python and ruby
False, PHP is objectively the fastest interpreted programming language, it beats ruby, python, node, lua, erlang and elixir, and it can get to C speed when you enable JIT + OPCache, so if you really know the language you can get amazing results.
> Types are just hints
Completely false, in PHP types are optional, but if you decide to assign a type to a variable, parameter or function return you must respect it or it will throw an error.
>Slower than python and ruby
kek
python/ruby is like 4 times slower than php, unless it's some cpython variation
https://www.techempower.com/benchmarks/#hw=ph&test=fortune§ion=data-r22
>fastest python 69k
>fastest ruby 56k
>fastest php 290k
PYTODDLERS BTFO
Ugly syntax
>tell me flaws of PHP 8.2+
an update quadrupled the memory usage of php in some use-cases, and it's artificially limited at 128mb of maximum ram usage by default in the configurations of already deployed systems so the product the company he works at sell is fricked until 8.4 """maybe""" fixes it
what kind of fricking programming language has a "config-time" maximum ram usage limit? holy shit
>he
meant to say "a friend"
no async
no generics/type parameters
no sum types
No generics
No method overloading
t. php dev
function name inconsistency and function argument order inconsistency
The only thing that sucks about PHP is that no modern company use it
For good reasons, I assure you.
Same as Perl, with the notable difference that PHP has WordPress to pull it forward. If WordPress disappeared tomorrow, people would forget about PHP just as everyone forgot about Perl and Ruby.
>dude, laravel dude
>yii man
>we symphony here
>this is a mature programming language, just look at the version
>still seething that the best webdev language in #1
moron language architects should have read the room and made what people wanted. Now we have a bastard language from rasismus leerdorf.
Too many pajeets flooding this after java is now full
I love PHP, but there's one thing that makes me want to fricking pull my brains out
NO FRICKING THREADING
>inb4 le pthreads/parallel extension
REQUIRES ZTS SUPPORT
parallel is unfinished, pthreads is outdated
ZTS requires you to compile the shit and no one knows how, and a script on github that lets you set it up for you nukes your /usr/sbin folder
Laravel uses an event loop, so you cant use curl functions because it blocks I/O. PSR codestyle is awful. No good websocket library, and I tried many many many many times to implement one but I keep hitting roadblocks cause of being forced to use processes.
Currently learning C because of the threading problems...
>Currently learning C because of the threading problems...
why didn't you pick golang if you want a web lang with a good concurrency model
I want to suggest that everyone here try JS, it's an amazing frankenstein's monster language that can do everything, also it can run everywhere. it's fast to code in, and computers nowadays are so fast that an interpreted language is a non-issue. When you learn the language you instantly become a full-stack engineer and you'll be able to create pretty much anything you could dream of.
It has the most optimized runtime in the world, it's only a few times slower than eg rust or c... why take on the incredibly steep learning curve to grok rust? why open yourself to "footgunning" by manual memory management?! Humans don't think like machines wheny they want to do _anything_.
"Did I remember to free all the memory pointed to by these pointers?" - words uttered by a madman.
Scaling horizontally solves 99.99% of "performance problems" anyways, so you can keep paying $$ instead of your precious developer time until you can afford to hire someone who specialized into RUST (so he can do the inevitable "rewrite it in rust").
Don't waste your time... just write JS to get shit done. High level languages are where it's at, never look back. But don't use PHP.
the fullstack from devops, testing, vendor management is all over the fricking place with its own fricking way of doing things that follows their own standards. JS ecosystem is a more leaner approach. PHP you dont have too many choices.
php chuds should just accept that python won the scripting language race.
Gemephant
why does it make trannies seethe so much??
>tell me what's bad about PHP 7.4+
it's PHP
>tell me flaws of PHP 8.2+
it's still PHP
People still use this trash? Seriously the worst thing to happen in computer science. Arguably perl is a better language than this shit heap.
the pants on head moronic syntax for function passing
https://www.php.net/manual/en/language.types.callable.php
The first class callable shit from 8.1 is acceptable.
For 8.2, I'd say the lack of function overloading. We got typing to an acceptable degree, but you can't (and probably won't ever) be able to call a function with different arguments and get different behavior without conditionals out the ass and ugly parameter lists
>tell me something bad about PHP
it's web tech
it's ugly. and annoying to set up.
uh. yeah that's it actually.
still will use asgi and python though, since 90% of the time i'm not generating html.