News for hackers. Stuff that matters.
Re:Everything you need (and don't need) to know about PHP's ... by jonny383 on Sunday July 26, 2020 @12:27AM (#23954441)
PHP rocks in 2020. Couple it with laravel or something and you get a solid platform to build a monolith-type web app with really fast performance.
Re:Everything you need (and don't need) to know about PHP's ... by noir_lord on Sunday July 26, 2020 @06:09AM (#23955898)
It's gotten a lot better since I started using it ~2009 and now.

7.4 added typed properties. 8 is adding better caching, a jit and my favourite feature

    match()
https://php.watch/versions/8.0#match-expression

for all the enterprise heavy stuff I write a nicer cleaner and safer (by default) alternative to switch is going to make some code much cleaner to write and read and really that is what I care about more than almost anything else.

That it also returns a value is just the cherry on top. I am so tired of reading bad code with poor intent that has no comments and no documentation that's written in the most counter intuitive way.

Re:Everything you need (and don't need) to know about PHP's ... by untog on Sunday July 26, 2020 @01:12PM (#23958476)
Match looks exactly how Rust’s match works and it’s one of my favourite parts of the language. Happy to see it elsewhere too.
Re:Everything you need (and don't need) to know about PHP's ... by epse on Monday July 27, 2020 @06:32AM (#23963778)
It doesn't really pattern match like rust, but it's still very useful
Re:Everything you need (and don't need) to know about PHP's ... by nawarian on Tuesday July 28, 2020 @06:05AM (#23974132)
Re:Everything you need (and don't need) to know about PHP's ... by admissionsguy on Sunday July 26, 2020 @07:34AM (#23956294)
The match expression is so elegant. For the past 10 years I've been puzzled by how verbose switch is.
Re:Everything you need (and don't need) to know about PHP's ... by noir_lord on Sunday July 26, 2020 @10:23AM (#23957226)
It's better than switch for a lot of switch use cases, it's still not 'real' pattern matching but yeah I'm looking forwards to it.
Re:Everything you need (and don't need) to know about PHP's ... by bnt on Sunday July 26, 2020 @02:48AM (#23955013)
Isn’t Laravel the worst performing framework out there right now, like even Rails looks like a viable option in terms of speed?
Re:Everything you need (and don't need) to know about PHP's ... by jonny383 on Sunday July 26, 2020 @04:25AM (#23955412)
Ruby is slower than PHP7+ by orders of magnitude. I doubt it.
Re:Everything you need (and don't need) to know about PHP's ... by amval on Sunday July 26, 2020 @06:42AM (#23956046)
Orders of magnitude? Do you thibk that PHP is at least x100 times faster than Ruby?
Re:Everything you need (and don't need) to know about PHP's ... by jonny383 on Sunday July 26, 2020 @08:38AM (#23956658)
Alright, maybe an exaggeration. But the difference is huge. https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
Re:Everything you need (and don't need) to know about PHP's ... by tutfbhuf on Sunday July 26, 2020 @09:11AM (#23956812)
Well that is a benchmark with a set of specific mathematical problems like calculating pi digits. I would rather compare Rails with Laravel e.g. in terms of requests per second or speed of json deserialization. See https://www.techempower.com/benchmarks/ Symfony, Lumen and Rails seems to be somewhat equal in performance, but Laravel is a bit slower in respect to the benchmarked web related criterions.
Re:Everything you need (and don't need) to know about PHP's ... by noir_lord on Sunday July 26, 2020 @06:07AM (#23955887)
> Isn’t Laravel the worst performing framework out there right now.

I'm more of a Symfony than Laravel guy but I've done both enough to know that application architecture and environment configuration has more of an impact than either framework's "performance" does.

Silly things are slow in most web frameworks.

Re:Everything you need (and don't need) to know about PHP's ... by Can_Not on Monday July 27, 2020 @06:44PM (#23970299)
The last time I looked at a rails-clone framework speed comparison chart rails was the slowest, with some Sinatra clones being the fastest.
Re:Everything you need (and don't need) to know about PHP's ... by fraktl on Sunday July 26, 2020 @06:20AM (#23955953)
No. Laravel performs quite nicely. Rails can't be compared to Laravel, it's slower by an order of magnitude, as mentioned previously.

Any framework bears overhead, they all optimize programmer's time invested into solving the problem. It's cheaper to buy hardware and scale horizontally rather than swap languages and frameworks hunting for performance.

PHP being synchronous by nature is what limits its performance, but we have Swoole that fixes it and makes it faster.

For the ones who will google what Swoole is, some benchmarks I've done on my laptop show 5x (yes, 5 times, 500%) increase in performance when Laravel is ran via Swoole.

Re:Everything you need (and don't need) to know about PHP's ... by tutfbhuf on Sunday July 26, 2020 @09:30AM (#23956922)
> No. Laravel performs quite nicely. Rails can't be compared to Laravel, it's slower by an order of magnitude, as mentioned previously

No, that's outright wrong. Please see the well respected techempower web benchmark: https://www.techempower.com/benchmarks/

> For the ones who will google what Swoole is, some benchmarks I've done on my laptop show 5x (yes, 5 times, 500%) increase in performance when Laravel is ran via Swoole.

Yup, that seems to be correct. What are the drawbacks of Swoole?

Re:Everything you need (and don't need) to know about PHP's ... by fraktl on Sunday July 26, 2020 @11:48AM (#23957927)
> No, that's outright wrong. Please see the well respected techempower web benchmark: https://www.techempower.com/benchmarks/

I just notified the servers I've to manage (and my coworkers) that we're outright wrong and the load we're seeing is phantasm and that guy from internet told us so since he linked the well respected techempower benchmarks, which apparently reflect real world situation :)

Re:Everything you need (and don't need) to know about PHP's ... by tutfbhuf on Sunday July 26, 2020 @02:20PM (#23958988)
If you and your co-workers have both Rails and Laravel in production and your Laravel applications performs better, then I have absolutely no doubt about that. However, there is no evidence that Rails is an order of magnitude slower than Laravel in general, quite the contrary, benchmarks indicating that (non-swoole) Laravel is slower.