I've actually been really impressed with Laravel after switching back to PHP for a few projects. Not only is the developer tooling experience some of the best I've experienced, it's just really the only framework I've ever experienced with a high quality ecosystem of tools—from Forge[1], which makes it dead-simple to deploy a Laravel app into production to things like Horizon, for managing Redis queues. A great examp…
PHP in 2019
461–470 of 489 posts
Re: PHP in 2019
#462Earlier quoted context omitted.
Thanks. Again, I am asking out of ignorance: What is PHP's concurrency model? Is it still a forked process pool via something like PHP-FPM, or has it changed? Does the VM enforce a GIL? I'm assuming there is some kind of threading API? Can you run an event loop using epoll, and is the standard library well supported in that execution model? FYI, I was a PHP developer from 2003-2011. I did enjoy it back then. I never…
> What is PHP's concurrency model? Is it still a forked process pool via something like PHP-FPM, or has it changed? > Does the VM enforce a GIL? I'm assuming there is some kind of threading API? As far as I'm aware PHP is still mostly run PHP-FPM. It also does have a threading API: https://www.php.net/manual/en/class.thread.php > But I was ignorant. Honestly, after switching to Python for web dev, I saw no reason to…
I think if you're building CRUD apps over and over again, then yeah, there isn't too much difference.
But if you're building a web service with more complicated business logic and you need more control over your concurrency model, then other languages look more appealing.
And it looks like PHP doesn't have JIT yet, which is another huge mark against it.
So PHP is probably fine for passing params and rendering back HTML. But anything sitting in between that's more interesting should be built in something else.
Re: PHP in 2019
#463Earlier quoted context omitted.
The vast majority of people using a package manager in the PHP ecosystem are using composer. It makes sense to call it "the" package manager.
I’d argue that the only “the” is one that’s distributed with it, which is PEAR. I’m not saying PEAR is used more or that it’s better, just that it’s the only one close to “default” with the language distributions.
Re: PHP in 2019
#464Earlier quoted context omitted.
Except PHP is not Java, and it never can be. What is PHP's multithreading model again? Hotspot VM? NIO? I'm sure someone will chime in and cite something similar in PHP, but the comparison will be laughable in reality.
I'm not a concurrency expert (haven't had to do much high-performance stuff), but php does have coroutines like go's --if you use swoole, the performance is actually higher than node in some benchmarks and other multi-threaded / parallel programming paradigms, which comforts me to know that if I have the use case it's there, so I don't necessarily need to drop everything and pick up rust or java or go or another lang…
Re: PHP in 2019
#465Earlier quoted context omitted.
Coroutines do not mean that you get parallel execution. Concurrency is not the same as parallelization. If PHP does not have JIT, then it's nowhere near the speed of Java. Even if it did, Java would likely beat it significantly. I would encourage you to read about Java's Hotspot VM and its adaptive optimizations.
Multithreading is not strictly parallelism, typical discussions of multithreading regard concurrency, and multithreading is what you initially asked about. PHP 7.4 will ship with a JIT as an experimental feature and PHP 8 will ship with it built in standard.
You're confused. Nowhere did I claim that multithreading always means parrelalism.
Re: PHP in 2019
#466Earlier quoted context omitted.
I used both Laravel and Symfony but I ended up with the second. I didn’t like the way Laravel’s ORM has its models structured plus the Symfony PHPStorm plugin is a miracle. Your mileage may vary and this is just me but I never quite understood why people ended up loving Laravel so much vs. Symfony.
I feel Laravel is fantastic for Junior and medior programmers, while Symfony appeals more to seniors.
Re: PHP in 2019
#467Earlier quoted context omitted.
Features that I miss in PHP: - expressive type system with generics, union types, literal types, basically TypeScript. I can say "this function returns a string" or "this function returns an array", but not "this function returns an array of strings". - specialized collection/hashmap data structures with good support across third-party libraries. Having one array() structure acting as both a sequence and an associati…
It looks like Facebook had your exact problem; you want Hack: https://hacklang.org It's based on PHP, but adds: Expressive type system with generics: https://docs.hhvm.com/hack/types/generic-types Specialized collections: vec, dict, keyset https://docs.hhvm.com/hack/types/arrays Templating solution similar to JSX: XHP https://docs.hhvm.com/hack/XHP/some-basics
[0]: https://github.com/doctrine/collections
[1]: https://github.com/schmittjoh/php-option
Re: PHP in 2019
#468On one hand, I do see that HN (and probably Reddit) live in a bubble. Where most of the darling languages and tools have very low use in the real-world. And where most of the languages and tooling that actually run the real-world go un-discussed, or simply dismissed, because they're boring and don't appeal to students and entry-level devs working on side projects. I realize that the perspective most rookies get from…
I think the bubble has to do with purists vs pragmatists. I once joined a Java team as a front-end dev (I'm full-stack). They would do the back-end. They had done everything by the book perfectly. Following all the best practices. But the back-end wasn't doing what it needed to do by a long shot. They were stuck. Meaning I couldn't make progress. So I cooked up a simple (temporary) PHP back-end so I could easily buil…
I shipped apps in 2 weeks myself that the company got paid ~70k for. And we kept my clients.
Re: PHP in 2019
#469Re: PHP in 2019
#470Earlier quoted context omitted.
My issue with modern PHP is that it's essentially becoming Java. And with the JVM and the Java ecosystem, what is the compelling reason to not just pick Java at this point? With Java you are basically writing exactly what you would be writing with PHP, except with more language features and the ability to opt into other languages on the JVM like Kotlin and Scala. The modern additions are fantastic for projects and te…
Java is killing itself at a rate of 6 months. They removed javapackager, which means the official tool to build releases is missing from the LTS version. The EE ecosystem is collapsing thanks to Oracle opposing the Eclipse Foundation, making the quest to build enterprise applications challenging due to namespace collisions and overrides, because of modularisation. PHP is on this aspect still strong and you can still…