php

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

tsonfeir, in Why PHP Usage Has Declined by 40% in Just Over 2 Years
@tsonfeir@lemmy.world avatar

PHP is great when you use it right. The problem is, most people don’t use it right. That old way of rendering html through PHP, or worse, injecting PHP into html, is antiquated.

IMO, PHP is a great language to use for making your backend API. Use whatever flavor of the week on your front end.

Olissipo,
@Olissipo@programming.dev avatar

Aren’t you only saying, indirectly, that server-side rendering is “antiquated”?

Unless you mean that mixing logic with templates is bad, in which case I agree.

tsonfeir,
@tsonfeir@lemmy.world avatar

Well, both?

There’s always a use for server rendered html. Maybe JavaScript is an issue. But it’s usually not. The list is pretty short though.

I can’t think of many situations where I would say yes if I asked myself “if you could re-do the system today, would you still choose server-rendered html?”

I’m sure other people have use cases where it would make sense. I build admin utilities and ERP stuff.

Olissipo,
@Olissipo@programming.dev avatar

That’s a valid opinion. And I admit that at some point you must move to some form of client-side rendering.

I still haven’t (for some admin panels too, and websites), so I don’t feel the need to switch.

tsonfeir,
@tsonfeir@lemmy.world avatar

Well, if it ain’t broke, and you’re not getting paid to refactor it, don’t fix it.

spartanatreyu, in Why PHP Usage Has Declined by 40% in Just Over 2 Years
@spartanatreyu@programming.dev avatar

TIOBE index, literally in the first sentence…

PHP leaves a bad taste in my mouth and I’d be happier if we were rid of it (or it continued changing for the next 10 years), but even I can see this article is worthless.

shnizmuffin, in How do I create dynamic websites using PHP/javascript/HTML/CSS?
@shnizmuffin@lemmy.inbutts.lol avatar

Yes.

monomon, in I have suddenly inherited a PHP project. What VSCode extension or server is best for developing it locally? I’m down with any other suggestions too!
@monomon@programming.dev avatar

ddev saved my life when I inherited a drupal project.

buzz, in Symfony 7.0.0 released (Symfony Blog)
@buzz@lemmy.world avatar

Add native swoole suppport

tsonfeir, (edited ) in PHP 8.3.0 Released
@tsonfeir@lemm.ee avatar

Glad to see those json functions for better 🙄

abhibeckert, in Understanding the Strategy Design Pattern in PHP with a Simple Example

<span style="color:#323232;">class SendVerificationEmail extends Notification {}
</span><span style="color:#323232;">class SendAnnouncementFCM extends Notification {}
</span><span style="color:#323232;">class SendOtpSMS extends Notification {}
</span>

What’s the point of those three classes? Why wouldn’t you just use Notification directly?

mac,
@mac@programming.dev avatar

In the given example they don’t make much sense but I assume they’ve done that in case they want them to be extended with new behaviour for certain ones separate from their strategy pattern section in the future

abhibeckert,

Yeah I assume the same, but I’d really like to see a concrete example of that being done instead of having to guess (as someone who has never used the Strategy Design Pattern).

Sibbo, in PHP Weekly - November 9th 2023

Wait, PHP is still alive?

rikudou,
@rikudou@lemmings.world avatar

Alive and well, still powering most of the web.

alx, in FrankenPHP 1.0 Beta
@alx@programming.dev avatar

Looks interesting. What are the key differences to roadrunner.dev?

spartanatreyu, in Changes you would love to see in PHP?
@spartanatreyu@programming.dev avatar

This one right here: wiki.php.net/rfc/consistent_function_names

Right now the only reason I ever use php is because I have to.

This one simple change would bring me half way to wanting to use php for fun (the other half would be making debugging easier).

prwnr,

Could you wrote more about that debugging? I’m curious what you find not easy.

spartanatreyu,
@spartanatreyu@programming.dev avatar

Mainly because you’ve got to setup PHP to be debuggable in the first place.

And setting up PHP is already a hassle. When a dev has to set up php in about 5 separate ways just to figure out which one is actually debuggable, then PHP has a problem.

dbx12, in Welcome to /c/PHP!

Hey, I’ve came over from Reddit and thought I’ll introduce myself as well. As every programmer, I’ve started way too many pet projects and almost all of them are starving. In terms of framework, I prefer Yii2 over Laravel every day. I feel like Laravel provides you a dozen different (seemingly equally good) ways of doing something. You could say it’s lacking clarity or guidance for the developer.

mbd,

Hey, welcome! Classic haha, I have far too many pet projects as well 😅

And yeah agreed, it’s a bit dizzying to choose a Laravel “path”. Would probably be helpful to have a documentation page sort of like the Remix Stacks where they talk a little bit about which “path” to choose depending on app needs.

dbx12,

Docs is another topic I really don’t like about Laravel. Why don’t you have a simple API doc with available functions and their parameters instead of that blog-style documentation. And no, I don’t want to watch a video about how to use X, I want to know what functions I can call. Oh and don’t get me started on all their global “helper” functions.

Buddhist1961,
@Buddhist1961@programming.dev avatar

This is not a comment trying to convert you to Laravel, but if you or anyone else is interested, an API doc actually exists and is available here.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php@programming.dev
  • random
  • meta
  • Macbeth
  • All magazines