Earlier quoted context omitted.
The Laravel framework ( https://laravel.com ) and its growing ecosystem and welcoming community is a great example of this renaissance.
Is it? Laravel effectively has a single maintainer, as its other contributors seem to have abandoned it[1]. It also seems to have declining interest after peaking in 2017[2]. EDIT: I was looking at the wrong repository, so my comment about Laravel's popularity is wrong. 1. https://github.com/laravel/laravel/graphs/contributors 2. https://trends.google.com/trends/explore?date=today%205-y&ge...
PHP 8.0.0 beta 2
51–60 of 102 posts
Re: PHP 8.0.0 beta 2
#52Earlier quoted context omitted.
What are the memory leak problems? I was under the impression that PHP's stateless nature, with a whole new instance of everything coming into being for each request, somewhat sidesteps the capacity for problematic memory leaks that could otherwise exist for processes that remain alive between requests.
> I was under the impression that PHP's stateless nature, with a whole new instance of everything coming into being for each request A couple issues here. 1. Even if the PHP process exits after each request, memory leaks during the request are still an issue. If I'm looping through 1,000 elements of an array and leaking memory each time, I could end up with a peak memory usage of 100MB when 1MB would've sufficed. Tha…
2. There's a large amount of PHP libraries built to do exactly what you're describing. Long lived PHP processes are live in production across the world.
Straight up misinformation.
Re: PHP 8.0.0 beta 2
#53Earlier quoted context omitted.
> Is there anything that PHP is developing or adopting that can not be had at other established languages? IMO, no. The language is still near the bottom for both dynamic and "static" typed languages. HOWEVER, if you're doing web backend stuff, Laravel and Symfony are both really solid frameworks. The direction PHP Is moving in right now is to emulate Java 7, but without generics or concurrency. It's definitely a dea…
> IMO, no. The language is still near the bottom for both dynamic and "static" typed languages. Why do you say that? It's faster than Python and Ruby for most cases, still extremely simple to deploy, the package manager (Composer) is very predictable and easy to deal with compared to Pip or Rubygems, the documentation is good, etc. It has clean lambda functions that you can pass around easily and has for more than a…
Hardly. PHP-FPM is a confusing mess to set up, and you're still stuck working around the massive mistake of binding routing to the file system.
And I hope you don't try to just rsync up your changes afterwards without some form of blue/green deployments.
> the documentation is good
There is.. a lot of it, for better or worse. Let's compare the functions for concatenating lists between PHP[0] and Scala[1]. The PHP version is way longer and contains several examples.. that are only needed in the first place because the PHP's array type is so messy and tries to fill so many different uses. Meanwhile, Scala's gets to the point, describes how to use it, and uses the rest of the screen estate to help me navigate to anything else that might be relevant.
> It has clean lambda functions that you can pass around easily and has for more than a decade.
Looks like they did finally clean up their baffling closure binding syntax in 7.4... unless you want to bind anything by reference.
That said, it is pretty hilarious to me that they decided to make strings and arrays of strings callable rather than add some kind of first-class function reference syntax. Surely that won't have any confusing interactions with namespaces...
> Type hinting has been in place for a long time
Not of much use without generics. `array` isn't a particularly useful type. There does seem to exist an RFC[2], but it looks dead in the water (no voting table, and the stated vote goal was years ago).
> The only downside of PHP that I can still point to is that it's sometimes hard to remember the function parameter order for some of the common string and array functions.
It's not really PHP's fault itself, but Laravel is a miserable mess of implicit magic. The fact that people often seem to hold it up as the gold standard of PHP doesn't exactly inspire confidence in the community.
[0]: https://www.php.net/manual/en/function.array-merge [1]: https://www.scala-lang.org/api/current/scala/collection/Seq....):Seq[B] [2]: https://wiki.php.net/rfc/generics
Re: PHP 8.0.0 beta 2
#54Earlier quoted context omitted.
The Laravel framework ( https://laravel.com ) and its growing ecosystem and welcoming community is a great example of this renaissance.
Is it? Laravel effectively has a single maintainer, as its other contributors seem to have abandoned it[1]. It also seems to have declining interest after peaking in 2017[2]. EDIT: I was looking at the wrong repository, so my comment about Laravel's popularity is wrong. 1. https://github.com/laravel/laravel/graphs/contributors 2. https://trends.google.com/trends/explore?date=today%205-y&ge...
https://github.com/laravel/framework/graphs/contributors
To me it seems like the ecosystem is growing rapidly. There are at least three large conferences each year, a handful of established podcasts and an excellent video tutorials site. There are also a number of paid services like Vapor for running Laravel on Lambda, Forge for easier server management and Laravel Shift for automatic version upgrades.
Re: PHP 8.0.0 beta 2
#55Earlier quoted context omitted.
I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…
I don't know how can you blame the hacking of your website on the language rather than your admin skills, there infinite number of websites built in PHP and never got hacked!
Re: PHP 8.0.0 beta 2
#56PHP, since version 7.0, has been a much improved language since when many people started hating on it. They have been consistently moving the spec forward and making improvements. It's not perfect, but no language really is after all. It is really nice just seeing issues that have been around for a long time being addressed and fixed.
I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…
One thing that PHP does better than any other language for web development is ease of deployment. It isn't really anything inherent in the language that makes it easier to deploy, it's simply that hundreds, probably thousands of web hosts have made deployment easy for PHP. Also, the PHP community has documented deployment and installation scenarios thoroughly.
Deployment might sound like a small piece in the overall picture of building a web app but it is actually hugely important. If you want your users to self-install your web app, or to give them the widest possibly choice of deployment hosts, then PHP beats every other language by a mile.
I always mention this quote from blogger and programmer Jeff Attwood on this topic of depolyment:
"If you want to produce free-as-in-whatever code that runs on virtually every server in the world with zero friction or configuration hassles, PHP is damn near your only option." [1]
Guess when he wrote it? 2012.
Sure, we've got VPS and even more hosting options, but in 2020 what other languages can match or even surpass PHP's ease of deployment? Can you give instructions to your relatively non-tech users and tell them how to successful deploy your web app with the same ease as PHP?
Re: PHP 8.0.0 beta 2
#57Earlier quoted context omitted.
Is it? Laravel effectively has a single maintainer, as its other contributors seem to have abandoned it[1]. It also seems to have declining interest after peaking in 2017[2]. EDIT: I was looking at the wrong repository, so my comment about Laravel's popularity is wrong. 1. https://github.com/laravel/laravel/graphs/contributors 2. https://trends.google.com/trends/explore?date=today%205-y&ge...
You're looking at the bootstrap install repo. That's barely changed since 5.0 was released in 2015-ish. The framework repo[1] is still being maintained by many different developers and sees a significant new release every 6 months. Taylor still accounts for a significant amount of contributions, but it is his project afterall. Also worth noting that the framework has pretty much reached maturity at this point and upd…
Re: PHP 8.0.0 beta 2
#58I heard about PHP is really just used by wordpress and drupal to keep its popularity ranking these days, and new projects seldom adopt it based on google trends, is this true? The new PHP7/8 is certainly exciting, is it too late?
Re: PHP 8.0.0 beta 2
#59Earlier quoted context omitted.
> Is there anything that PHP is developing or adopting that can not be had at other established languages? IMO, no. The language is still near the bottom for both dynamic and "static" typed languages. HOWEVER, if you're doing web backend stuff, Laravel and Symfony are both really solid frameworks. The direction PHP Is moving in right now is to emulate Java 7, but without generics or concurrency. It's definitely a dea…
> IMO, no. The language is still near the bottom for both dynamic and "static" typed languages. Why do you say that? It's faster than Python and Ruby for most cases, still extremely simple to deploy, the package manager (Composer) is very predictable and easy to deal with compared to Pip or Rubygems, the documentation is good, etc. It has clean lambda functions that you can pass around easily and has for more than a…
The type system is weaker than Java, which is a low bar.
It has no generics, which means no real containers, no generic functions without dropping all typing, no type-hinted arrays.
Arrays are also not objects, so they don't conform to any interfaces, which is related to the "no real containers" issue.
It took until version 7.4 to actually have covariance and contravariance! Before that it didn't even implement inheritance correctly!
You can't typehint for function-as-param beyond just writing `callable`. So if you want to use those nice lambdas and still be statically typed, you're SOL.
It's definitely fast for a scripting language! So, that's fair. But it's still way slower than many other good backend languages: Java and other JVM languages: Kotlin, Scala, maybe Clojure?, Go, Rust if you're feeling frisky.
I've never used Ruby and I'm generally biased against dynamically typed languages, so that's the background for my assessment. The dynamic languages I've used in anger are Python, JavaScript, Elixir, and Clojure.
The package manager is better than the disaster that Python was the last time I used it. Agreed. It's also better than NPM, but not enough to matter most of the time. It's not better than Hex or Lein. Also, managing packages is a) not the language, which is what I criticized, and b) not where you spend most, or even a large part, of your dev time.
Looking at PHP as a dynamic language, I'd say that the built-in array is still a huge disappointment and the API sucks compared to either of Python's dict or list. It's much cleaner in JavaScript, Clojure, Elixir, and Python to define and operate on new, untyped, objects.
Also, for a dynamic language, I'd at least want SOME benefit to it being dynamic. For JS, Clojure, Elixir, and Python, the REPLs are great. The PHP REPL is... primitive.
None of the things you mentioned in PHP are actually better than any other language I've used except for the package manager. Its lambdas are not even better than any of the languages I've listed. In 2020, decent lambda syntax is table-stakes.
Re: PHP 8.0.0 beta 2
#60PHP is damn good in certain areas. It is one of the best choices (if not the best choice) for rapid prototyping of a program. Its damn fast to similar alternatives (Python, Ruby, Dart, JavaScript), and the standard library is huge. It does have footguns. I am not a fan of the loose typing, but you can take some steps to mitigate. You can do "===", "strict_types" and type hinting for function input and output. It is s…
https://wiki.php.net/rfc/string_to_number_comparison https://wiki.php.net/rfc/saner-numeric-strings
In addition more internal functions throw exceptions instead of notice+return false on completly invalid arguments: