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... #coding 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?

#PHP #Programming

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! 😍

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

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.

SuitedUpDev, (edited )
@SuitedUpDev@mastodon.online avatar

For any in the room, please don't do this...

As an outsider is reading this, I have NO clue if the "handleUpdate", "handleCreate" or "handleDelete" methods are actually being used.

Edit: grammar do be hard yo.

Aedius,
@Aedius@lavraievie.social avatar

@SuitedUpDev

That's "useful" to transform entities to model, handle some multi heritance before the traits or to call a private method for a similar object in a dependency.

Bonus point when error are not handled

eurosat7,

@SuitedUpDev at least a method_exists() ... But this was rushed code for sure. Maybe even some fire and forget mentally of a freelancer on fixed budget. Trying to be smart and cutting some corners...
But that always will cost more in the end.

Crell,
@Crell@phpc.social avatar

Looking for feedback.

I have a lib build for PHP 7 that has 3 methods:

addFoo($id, $priority)
addFooBefore($id, $before)
addFooAfter($id, $after)

($before/$after refer to some other $id.)

For PHP 8, I am strongly considering just assuming named args and changing it to:

addFoo($id, $priority, $before, $after);

Specify only one of priority/before/after, by name. Multiple is an error.

Is this a good idea/bad idea, and why?

Crell,
@Crell@phpc.social avatar

@gmazzap Ilija and I want to work on it and have a decent amount of design already done for it. No promise on timeline, but the rfc text for it and for pattern matching (which will be required) are already written. (The former needs some updates, of course.)

gmazzap,
@gmazzap@phpc.social avatar

@Crell that would great. Thanks!

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. :-)

ocramius,
@ocramius@mastodon.social avatar

Looked again at a codebase written/maintained in PHP 5.5, where new code is designed and added on the existing app.

Made me realize that the only thing I miss from newer PHP versions is strict type checks, which came with PHP 7.0.

Everything else was provided by @psalm or @phpstan

From my PoV (person that reads internals, follows/votes on RFCs, etc.), there are almost zero feature additions that make newer PHP versions interesting.

Not justifying staying back: just noticed this.

saramg,
@saramg@fosstodon.org avatar

@ocramius @psalm @phpstan And people will still insist that upgrading is hard because the language is changing too fast. Sogh... :)

ocramius,
@ocramius@mastodon.social avatar

@saramg more like: "upgrading is hard because nobody writes automated software verification (tests)"

ramsey,
@ramsey@phpc.social avatar

A friend was telling me about guidelines for developing and deploying new services in their company, and one of the guidelines is “new services must not use .”

I’m not making this up, and this isn’t hyperbole. They actually have this listed on their company documentation.

zimzat,
@zimzat@mastodon.social avatar

@ramsey Yeah 😞 Companies do one thing, very poorly, in a language early on and then decide to throw out the entire stack instead of addressing the elephant in the room.

It's like the only way they can justify putting effort into something is if they can make the case it's not worth the effort necessary to fix it incrementally.

danjones000,
@danjones000@microwords.goodevilgenius.org avatar

This is why I decided to learn go last year. Not because I enjoy learning new programming languages (I do, it's just not the reason), but because I can make more with a year or two of go than nearly twenty years of PHP.

@ramsey @inthehands

alexanderschnitzler, German
@alexanderschnitzler@mstdn.social avatar

Hier haben doch letzte ein paar Leute über verschiedene Localization-Tools gesprochen, innerhalb und außerhalb der IDE. Wer war das und was waren die Tools?

alexanderschnitzler,
@alexanderschnitzler@mstdn.social avatar

@koehnlein @ErHaWeb 🙈🙈🙈

Nun, mit etwas Zeit und einem klaren Kopf muss ich zustimmen. Und ich denke was mich gestern verarscht hat ist ein ViewHelper hier im Projekt, der die Übersetzungen nicht escaped, anders als f:translate. So war ich der festen Überzeugung, dass es mein CDATA war, was zu interpretierbaren HTML-Tags führte, ist aber nicht der Fall.

Mea culpa!

koehnlein,
@koehnlein@mastodon.social avatar

@alexanderschnitzler @ErHaWeb You’re natürlich ebenfalls welcome. 😄

SenseException, German
@SenseException@phpc.social avatar

talks 10 years ago: "Use value objects instead of arrays."

PHP talks nowadays: "Use value objects instead of arrays."

klabauterjan,

@SenseException Everyone around me: still uses arrays instead of value objects 🥲

Crell,
@Crell@phpc.social avatar

@SenseException I blame popular libraries and frameworks that are still array-based. ( and AWS-SDK at the top of that list. , less than it used to be but still.) And people who cut their teeth on CodeIgnighter et al and never grew past that.

One of the many reasons I detest Laravel.

phpc,
@phpc@phpc.social avatar

Reply to this thread with the folks to follow on the Fediverse!

heiglandreas,
@heiglandreas@phpc.social avatar
Skoop, (edited )
@Skoop@phpc.social avatar

@heiglandreas @phpc I would add to that list: @afilina , @OndrejMirtes , @rskuipers , @ieatkillerbees , @ramsey , @lornajane . And so many more. Hard to list them all

packagist,
@packagist@phpc.social avatar

👋 We're hiring a Senior Software Engineer in Berlin or remote! 💻 Build high-quality supply chain tools for thousands of devs in the PHP ecosystem 🐘 with the makers of Composer.

We're a small experienced remote team, deeply caring about our customers and the quality of our product. 🧑‍🤝‍🧑 Help us maintain and improve key infrastructure for hundreds of businesses! 🎉

https://packagist.com/about/careers/senior-software-engineer-1

naderman,
@naderman@phpc.social avatar

@MarkBaker @Skoop @packagist We already have someone working with us in the UK, and had someone in the Netherlands, I imagine in principle there'd be a way to still make this work via e.g. an EOR company in the respective location, so that shouldn't stop you!

derickr,
@derickr@phpc.social avatar

@MarkBaker @Skoop I've no excuse to own one, or wear one. :-(

ChristosArgyrop,
@ChristosArgyrop@mstdn.science avatar

I think I am 50% done finding a quadrafecta : a simultaneous hit piece against & .

This one only manages to trash talk and , so it has some ways to go.

https://stefanoborini.com/why-r-is-the-new-perl/

PS 1Gotta admit that the point about the object systems in R is somewhat spot on
PS 2 gets a dishonorable mention
PS3 I will continue to find ways to continue using all 4 of the aforementioned languages, as they are all performant and deliver in complementary ways.

BobOHara,

@ChristosArgyrop trash talking PERL is easy - even Larry Wall did it

ChristosArgyrop,
@ChristosArgyrop@mstdn.science avatar

@Edwardsmoon @mjgardner @BobOHara @bduncan sed and awk are now being taught as a cool skill for bioinformatics, which is kind of nuts because in the 90s was the cool kid.

rubenaarts,
@rubenaarts@mastodon.social avatar

Yesterday @jrf_nl gives a great talk about PHP_CodeSniffer ( @phpcs ) at

She told us the importance of funding opensource projects and there is is not enough spoken about this. It was a critical warning that there are just a few people in the community where the hole community is depending on.

So lets talk more about how to support these great opensource projects.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@jaapio @ProvenPudding: Got it. Cheers!

ProvenPudding,
@ProvenPudding@fosstodon.org avatar

@itsjoshbruce @jaapio Meeting rescheduled as agreed. CU!

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