PHP

ramsey,
@ramsey@phpc.social avatar

If you voted against the Interface Default Methods RFC for , please take a moment to read some of the most recent mailing list replies, starting with @Crell’s here: https://externals.io/message/120725#120798

I agree this feature goes against a lot of what I’ve learned as “best practices,” but I did a lot of introspection on this and decided that this feature is good for the future of the PHP language. It unlocks a lot of potential.

Crell,
@Crell@phpc.social avatar

@ramsey The older I get, the more I think early Java did more to set back language design and OOP theory than any other system in history.

Crell,
@Crell@phpc.social avatar

@ramsey @tomasveneny This made me curious, so I did some research. I posted my results to the mailing list thread.

Short version: Implementing multiple inheritance is super common, and doing so via interface default methods is the most common way it's done. PHP is weird by not having multiple inheritance by now.

I did not expect that.

ramsey,
@ramsey@phpc.social avatar

Let’s get all controversial up in this

joepferguson,
@joepferguson@phpc.social avatar

@ramsey PHP Needs a code of conduct

MelvilleSpence,
@MelvilleSpence@phpc.social avatar

@ramsey OK
For the love of God learn before touching a framework like or
There’s a pretty good learning path at Laracasts that starts with

Crell, (edited )
@Crell@phpc.social avatar

I'm noodling with a data storage layer library in . specific. There's 2 options:

  1. Auto-generate SQL tables/views/queries off of PHP data types (with attributes)
  2. Auto-generate PHP classes off of SQL tables/views/queries.

Which would you prefer? The goal is fully typed interaction in PHP space, but I'm not sure which side should be canonical.

Which would you rather work with, and why? Assuming a "good" DX in either case.

Answer why in replies, boost for reach, etc.

awoodsnet,
@awoodsnet@phpc.social avatar

@Crell what I like about the dumb data holder approach, is that that the details are abstracted away. It’s easy to change the data layer.

i get your point though , and see the value in ti. There is a lot of power in databases. We could do more to take advantage of their capabilities. I think some people worry about getting to dependent on a particular database, so they avoid the DB-specific features.

Crell,
@Crell@phpc.social avatar

@awoodsnet Yeah, and DB portability has always been a lame reason. I say that as the person who wrote Drupal's DBAL, which was multi-db.

A project almost never changed its DB. But a product may want to slot in to different companies' standard tooling. That's why it exists, it for frameworks.

Of course, that forces a lowest common denominator approach, which is mysql 3.

Talix_Dreamer, French
@Talix_Dreamer@shelter.moe avatar

🇬🇧 I have tried PHP. I find this programming language more embedding in html. They completely get so much. I can code in live html. 🤯

Hence my question, why continue to code in JavaScript if php can do the same things?🔴😅⚠️

🇨🇵 J'ai essayé PHP. Je trouve ce langage de programmation plus incorporant dans le html. Ils se complètement tellement. Je peux coder dans le html en direct. 🤯

D'où ma question, pourquoi continuer à coder en JavaScript si php peut faire les même choses ?🔴😅⚠️

tshirtman,
@tshirtman@mas.to avatar

@Talix_Dreamer @Aedius ah, et c'est pour plus tard, mais tu voudra probablement ajouter SQL à cette liste, pour pouvoir stocker des données pour ton application. Mais bon, ton application actuelle n'en a pas besoin, alors je dirais de juste le noter pour plus tard, et de pas trop te laisser distraire :).

Talix_Dreamer,
@Talix_Dreamer@shelter.moe avatar

@tshirtman @Aedius

Punaise 😖

Je note. D'autres à rajouter ?😅

ramsey, (edited )
@ramsey@phpc.social avatar

Today, I was cut in layoffs. I’m so gutted because I loved this company, & my team was the best; I’ll miss my team most.

Now, as I look ahead, I’m searching for a staff/principal role where I can help other developers level-up through mentoring, tooling/infra, architecture, & improving DX. I’d love to work with a company contributing to open source & even to the programming language itself.

Update (27 Feb 2024): Thanks, everyone! I’ve accepted an offer. Please see update in thread below.

maccath,
@maccath@phpc.social avatar

@ramsey you are one of the greatest engineers I've ever had the pleasure to work with and I too will miss our team the most. Together, you, I and the rest of platform were the GOAT.

If anyone is able to hire both myself and Ben we absolutely promise to you that we will bring your team to unfathomable heights. 🙇‍♀️

ramsey,
@ramsey@phpc.social avatar

I know others are not so fortunate, and many have been out of work far longer than I was. I cannot imagine how I would have kept it together much longer.

Give everyone a healthy measure of grace. It’s rough out there.

If I can be of help to anyone (e.g., networking/contacts, advice for resumes/interviews/job offers, referrals, etc.), feel free to ask. I will try to help where I can. (2/2)

dantleech,
@dantleech@fosstodon.org avatar

have ported the best part of the Canvas widget from Ratatui to tui. It supports braille!

video/mp4

dantleech,
@dantleech@fosstodon.org avatar

ported the chart widget today, tomorrow I'll tackle the list/table widget...

video/mp4

dantleech,
@dantleech@fosstodon.org avatar

I've tagged a 0.0.2 of TUI - lots of bug fixes, linear gradient and the gauge, image, and barchart widgets, DX improvements for styling, inline and fixed viewports and more and a slightly pimped up README:

https://github.com/php-tui/php-tui/releases/tag/0.0.2

syntaxseed,
@syntaxseed@phpc.social avatar

Hey... question...

Say you have a function that has to return 1 of 3 states. Yes, no or N/A.

What's the recommended way to do this?

-Return an int flag?
-True/false/null?
-Return a value object?

syntaxseed,
@syntaxseed@phpc.social avatar

Related:

Say you have a method that generates a true/false result for success/fail along with a string message of various statuses describing what was done or not done... how do you return these?

  • Create a general-purpose Result value object that contains the success/fail & related message?

  • Return json or an array?

  • Return the bool but store the $lastMessage as a property of the method's class object?

  • Other?

🤔

syntaxseed,
@syntaxseed@phpc.social avatar

@livingcoder Hmm... I never work with enums but it might be time to start!

Crell, (edited )
@Crell@phpc.social avatar

Hey devs. I'm curious. When using a global class like SplFileInfo, Exception, Attribute, etc, do you say \Exception inline in the code, or do you use it at the top of the file and then use it as Exception inline?

derickr,
@derickr@phpc.social avatar

@Crell

use Exception as e;
use InvalidArgumentException as iae;

heiglandreas,
@heiglandreas@phpc.social avatar

@Schrank @jay @Crell Thou shalt not overwrite internal functions!

And methods belong to classes that shall be injected!

😁

(Hint: PSR-20 and Randomizer extension)

grmpyprogrammer,
@grmpyprogrammer@phpc.social avatar

To the folks lurking out here — hit me up with your questions and struggles with getting some kind of automated testing working

sephster, (edited )
@sephster@fosstodon.org avatar

@cabbey @grmpyprogrammer @kboyd I maintain the oauth2 server for the league. I will speak to someone about this to see if Phil needs a hand. Cheers

grmpyprogrammer,
@grmpyprogrammer@phpc.social avatar

@krinkle @phpandcigars Thanks for your comments — a lot of what you talk about is in my books ;)

codito, Polish
@codito@mas.to avatar

Had some problems with installation, it seems like SSL certificate expired (Monday, 11 September 2023 at 13:12:18).

🚨 @thephpf

image/png

derickr,
@derickr@phpc.social avatar

@ramsey @lewiscowles1986 now I've that ffing song in my head. THANKS BEN.

ramsey,
@ramsey@phpc.social avatar

@derickr @lewiscowles1986 You’re welcome! 😍

Crell,
@Crell@phpc.social avatar

And of course, this site features a half dozen languages and their package system... But forgets about .

Even if you don't use PHP yourself, ignoring one of the largest and best designed package systems (/) is just dumb.

https://deps.dev/

Crell,
@Crell@phpc.social avatar

@mwop My strongest argument about PHP being a good language is how popular and successful it is, despite the long, detailed list of organizational own-goals that PHP manages to pull off. Internals mainly, but user space a bit as well.

mwop,
@mwop@phpc.social avatar

@Crell I do market research yearly, and there's this really weird dichotomy of "PHP is everywhere, powers the vast majority of the web, and has a disproportionate number of developers worldwide" and "PHP is an antiquated language that nobody uses for new projects, nobody teaches, and there aren't enough developers". The truth is likely somewhere in the middle, but it's hugely flabbergasting.

1/x

jaapio, Dutch
@jaapio@phpc.social avatar

Scary thought... Did you know that a large number of infrastructure projects are maintained by 1 single person, some 2 or 3... But the original maintainer has been doing that for more than 20 years+ what would happen if they step down?!
They will retire at some point... Who will take over? Shouldn't we invest in the future and start education on how to maintain a opensource project with millions of users?

ramsey,
@ramsey@phpc.social avatar

@jaapio Awesome! Keep me posted!

jaapio,
@jaapio@phpc.social avatar

@ramsey just had my meeting, we discussed that most important is that we should make people aware about the pain. So let's start being loud about this. And start talking to people..
Not just here, but also at conferences, meetups and wherever people want to hear us.

ramsey,
@ramsey@phpc.social avatar

Most folks don’t seem to realize how gravely under-resourced and under-funded the project is.

For a technology that powers 77% of the web and has very little corporate backing, it's a wonder the project makes any headway at all.

At times, it almost feels like the industry is doing this on purpose to choke out the language.

ViejoViajero,
@ViejoViajero@phpc.social avatar

@ramsey Maybe many people do not know about https://opencollective.com/phpfoundation - might be because it is not linked on php.net?

derickr,
@derickr@phpc.social avatar

@ramsey @Crell Don't take this the wrong way, but I'm fairly happy it's mostly EU based administrated. Or at least that's a feeling, with so many other foundations being (mostly) weighted towards the US.

The PHP CC people had also been planning a similar organisation for the best part of a decade. But sometimes it just falls into place due to external factors, such as Nikita leaving Jetbrains.

fredbrooker, Czech
@fredbrooker@witter.cz avatar

if you want to learn PHP, the best way to do is 1) install phpstan and phpcs 2) analyze your code and bump the level up to 9

@phpstan @PHPCSFixer

Raccoon,
@Raccoon@techhub.social avatar

@fredbrooker @janantos
In all seriousness, suddenly wondering if anyone has made a web browser in Doom, and thinking about how the ability to navigate an HTML interface might actually make for some really cool moments in a GZDoom game. Like, I'd like to play some sort of cyberpunk game where you sit down and have to use websites for something...

fredbrooker,
@fredbrooker@witter.cz avatar

@Raccoon @janantos

you can play Doom on your washing machine, I used to play Doom on an SGI INDY worth 1 million CZK in 1995

ramsey,
@ramsey@phpc.social avatar

When you receive my replies to the internals mailing list, do they look empty to you? I just noticed that my messages on both news.php.net and externals.io appear empty.

https://news-web.php.net/php.internals/122829

https://externals.io/message/122811#122829

outofcontrol,
@outofcontrol@phpc.social avatar

@ramsey @heiglandreas Using mailmate on macos, which is plaintext markdown only. Would love to have that on iOS as well. But no.

ramsey,
@ramsey@phpc.social avatar

@outofcontrol @heiglandreas I want to keep using Apple Mail. It’s my preferred client. :-)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • DreamBathrooms
  • PowerRangers
  • khanakhh
  • magazineikmin
  • hgfsjryuu7
  • rosin
  • vwfavf
  • Youngstown
  • slotface
  • everett
  • thenastyranch
  • mdbf
  • kavyap
  • Durango
  • Leos
  • ethstaker
  • osvaldo12
  • InstantRegret
  • cisconetworking
  • GTA5RPClips
  • modclub
  • ngwrru68w68
  • cubers
  • tacticalgear
  • normalnudes
  • tester
  • anitta
  • provamag3
  • All magazines