Earlier quoted context omitted.
There is a garbage collection: https://www.php.net/manual/en/features.gc.php > This section explains the merits of the new Garbage Collection (also known as GC) mechanism that is part of PHP 5.3. > First of all, the whole reason for implementing the garbage collection mechanism is to reduce memory usage by cleaning up circular-referenced variables as soon as the prerequisites are fulfilled. In PHP's implementation, t…
PHP's garbage collector is ARC, unlike any other dynamic language that I know of. ARC is more performant but can introduce memory leaks via circular references, which is probably not a big problem for short-lived scripts anyway.
PHP in 2022
201–210 of 318 posts
Re: PHP in 2022
#202I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…
The value proposition *is* the ecosystem. Do I prefer coding Python to PHP? Sure (although it's not night and day difference by any stretch of imagination). Do I prefer Laravel or Django? Laravel. Do I prefer WordPress or ....? Actually, there's no equivalent, it's the one ton gorilla in that space.
When it comes to the 'classical' web (but also fun new toys like Laravel Livewire), there's very little that can compete with PHP as far as I'm concerned and the IMHO minor warts are certainly not worth losing the ecosystem for.
Re: PHP in 2022
#203Earlier quoted context omitted.
There is a garbage collection: https://www.php.net/manual/en/features.gc.php > This section explains the merits of the new Garbage Collection (also known as GC) mechanism that is part of PHP 5.3. > First of all, the whole reason for implementing the garbage collection mechanism is to reduce memory usage by cleaning up circular-referenced variables as soon as the prerequisites are fulfilled. In PHP's implementation, t…
PHP's garbage collector is ARC, unlike any other dynamic language that I know of. ARC is more performant but can introduce memory leaks via circular references, which is probably not a big problem for short-lived scripts anyway.
Re: PHP in 2022
#204Earlier quoted context omitted.
Quoted post unavailable.
Follow-up question: why is there always someone like you, shit-talking someone for an inoffensive post, demanding evidence while also refusing to waste your precious time providing any? Sorry if the cool kids are making make you feel left out, with their type systems and borrow checkers and monads.
Re: PHP in 2022
#205Earlier quoted context omitted.
I'm one of those web devs that tries everything under the sun, and I also happen to have worked for a lot of companies (more than a dozen already, I'm on my 40s). Laravel is such a *joy*. I've never had this feeling of using something so easy and productive. I've been recently building a side project with LiveWire and oh-my-god. I really wish I had discovered it before. From the templating system (you get components…
Did also plaid with Ruby on Rails, or even Sinatra, and how would your rank the dev XP compared to Laravel?
- I prefer things to be more explicit than implicit and lean more towards configuration over convention.
- I lean more towards having types/typing information than not having it
- PHP is way, way, way more used than Ruby
- Performance (just talking about development environment performance) is a lot better in PHP (no server restarts, etc)
- Availability of third party libraries is a lot stronger on the PHP side, probably due to it being more popular
- Tooling and editor support. This is a big one for me, and I've found out things to work a lot better with VSCode for PHP than for Ruby. Probably related to it being both, more popular and more explicit.
- Overall, Laravel feels even more complete than Rails and just fits better my brain.
But, I think Rails is still great, and I would use it over building a microservices mesh of Go servers on kubernetes with React frontends, etc, etc.
Re: PHP in 2022
#206Re: PHP in 2022
#207Earlier quoted context omitted.
I've being used PHP since it was Personal Home Page (3.x or something). The reason I moved away from it, is it is language make up. Some point around 4 it try to become Java OO style (ok ES6 is trying to do that too). The main reason moving away from it is because would like to have language that has function as a first class citizen, and JS seems to fit the bill. Once I found the joy of developing with proper closur…
PHP supports first class functions though?
Re: PHP in 2022
#208Wow, Php almost catches up with majority of programming languages!
Can't wait for: - Pattern matching in switch statements (done horribly wrong) - If, while, and switch expressions - Inferred type system - Consistent array method argument order - Actually usable higher order functions and reflection Big reminder: Php is a fractal of bad design, and I intensely hated using it at work for many years. The only good thing in Php is Symfony2 framework. https://eev.ee/blog/2012/04/09/php-…
Re: PHP in 2022
#209I'm glad the community around modern PHP is thriving, but filler articles like these are getting on my nerves. Reiterating a bunch of content that has already been covered extensively on the web in the past months (and in 10+ previous posts on your own blog), slapping a misleading title on it and filling it up with call-to-action's for your own personal video/newsletter/courses isn't good content. The author had some…
This article wasn’t done (and I’m still going to finish it, a “looking forward” section is missing)
I published it to get some feedback from the occasional reader, which I do more often. You can see I haven’t tweeted or posted it anywhere, I wanted to wait a couple of days still; so it’s a little unfortunate it got picked up here so soon. Of course I’m happy with the positive reception overall, but I agree that it’s not done yet.
On the part of self promotion within my own content: that’s just the way I’ve been doing it for years. I don’t feel guilty about mentioning other things I’ve made that I’m proud of and what I believe are high value as well. So on that part I don’t agree.
I do appreciate the overall feedback though, thanks for taking the time to share it
Re: PHP in 2022
#210Earlier quoted context omitted.
> Its concept of "one endpoint is one script" is one of its biggest killer features that no other language has been able to deploy in such an accessible manner. I don't see that as its biggest killer feature. In fact most projects built on PHP using a framework won't use the feature, as every request will be routed through a front controller. This has been true for at least a decade. I think the killer feature of PHP…
Could you elaborate on the shared-nothing architecture?
> Every web request starts from a completely blank slate. Its namespace and globals are uninitialized, except for the standard globals, functions and classes that provide primitive functionality and life support. By starting each request from a known state, we get a kind of organic fault isolation; if request t encounters a software defect and fails, this bug does not directly interfere with the execution of subsequent request t+1.
> An individual web request runs in a single PHP thread. This seems at first like a silly limitation. But since your program executes in the context of a web server, we have a natural source of concurrency available: web requests. Asynchronously curl’ing to localhost (or even another web server) provides a shared-nothing, copy-in/copy-out way of exploiting parallelism. In practice, this is safer and more resilient to error than the locks-and-shared-state approach that most other general-purpose languages provide.