Bringing “The PHP Community” together

Yesterday the PHPVerse online-conference was taking place. For reasons unrelated to what I am writing about here I didn’t participate. And let me be 100% clear: This is a personal opinion that is based on observations around the conference, not on the content itself!

What is PHPVerse?

PHPVerse is an online conference organized by Jetbrains and free to attend for everyone registered.

The idea is to connect different parts of the splitted PHP-Community which I endorse! So for this edition there were people from the Symfony-, WordPress-, Laravel- and the Drupal-Community doing sessions along with people vocal on the internals mailinglist, maintaining the PHP package manager and from the PHP Foundation.

But this is not about the content that these people brought. What hit me were three fundamental things about “The Community” that in my opinion need to be addressed differently and why I am increasingly weary of such events.

1. The Community

What community are we talking about here. Or let me ask this question slightly different: Which parts of “The Community” are we **not** reaching?

I realised that when I wanted to toot about the event: It doesn’t have an account on mastodon…

🤯

Yes! I know! There are several other social networks out there.

And on the main website of the event there are several social networks showing up right at the top: X, Facebook, LinkedIn and BlueSky.

Given that there is such a thing as a PHP-Community Mastodon server (at https://phpc.social) where an integral part of the PHP-Community is “hanging out” it seems like an odd choice to not at least include that in that list.

I understand that a “Free” event still needs to pay off for someone and that it is far easier to track “interactions” on walled-garden “social” networks. But if you want to do something **for** the community without a vital part **off** the community, that seems like “Doing it wrong™”

2. The time

Interesting was also the timing. When doing an online event, it is really hard to please everyone. Especially when you want to do an event in “only” 8 hours. Due to the nature of the world the PHP-Community is online almost 24h a day. It is spanning from New-Zealand, Australia and Japan on the east side all the way over to the Americas with Alaska and Hawaii reaching out furthest west. (Yes! There are some people even nearer to the date-line, I know!).

The event was set to happen from 11:00 UTC to 16:30 UTC. Which means 23:00 through 4:30 in Auckland. That requires some commitment to follow this event from there. Even as far west as the Indian Subcontinent – where the event took place from 16:30 through 22:00 that requires some commitment to follow that late into the evening.

When I realized that I immediately had to think about this tweet from 2021:

Only that this time event Japan, Australia and New Zealand are missing.

Again: “The Community” is actually only a part of the community that we are talking about.

3. The people

And then I stumbled upon a toot from Pauline Vos:

Just saw the trailer for the PHP documentary shown at PHPVerse…

ZERO women? Are you serious? 5 women (including at least 3 past or present core developers that I know of, and the executive director) on the @thephpf , and the story of PHP includes ZERO women?

Not to mention those prominent in the community that aren’t part of the Foundation itself. You can’t be serious.

Yes! There are not that many women around in the PHP Community. One might think. But actually there are. But with this kind of marketing, that amount will – to put it mildly – not increase.

Again: A huge part of the community not only lost but actually alienated.

Takeaway

To summarize: Time, Interaction and trailer-Content indicate that “The Community” the PHPVerse is talking about, is the European and North-American male dominated part that is still hanging out on the BigCorporation networks.

That is not the PHP Community I know and that I consider myself a part of. On the contrary! That seems to be the image that the PHP Community needs to get away of to actually become a world-wide, welcoming, vibrant, and healthy community.

Oh! And before you start responding with reasons why something doesn’t work or can’t be done differently: Think about this:

Where there’s a will, there’s a way; where there isn’t, there’s an excuse.

Code-Coverage with PCOV in a mono-repo

Today I finally managed to find and fix an issue that we had for some time with Code-Coverage generation with PCOV in github actions.

To give you a bit of background, imagine a project that uses 2 separate folders where one contains the business-logic and one contains the framework-related code. The framework-related part contains a lot of integration and end-to-end test that – of course – also use and therefore test the business-logic.

Every PullRequest runs the tests both from the bunsiness-logic part as well as from the framework-related part. And to give the developers feedback how well the changed code is covered with tests we collect coverage data and generate a patch-coverage report. I wrote about that some time back. So we now get a comment each in the PR that contains the untested lines in the business-logic related part and the framework-related part respectively.

That worked flawlessly for the business-logic related part as those were mostly unit-tests that do not rely upon the framework-related code.

The framework-related part though didn’t work that great. It always showed the business-logic related parts as untested even though I knew they were tested.

Continue reading Code-Coverage with PCOV in a mono-repo

Property-Hooks for the win

Property-Hooks were one of the really hot topics of last years PHP8.4 release. And I do have very strong opinions on them. They were and probably still are extremely hyped for something that in my personal opinion should be a very niche thing. In new projects you shouldn’t really need them.

But just today I had one of those situations where they helped me combine legacy code with new functionality.

The starting position

I am working on a project where we are using PDO and especially PDO::FETCH_CLASS to create Objects from our database-content.

So the code looks something like this:

Foo looks something like this:

And the database-table looks something like this:

Everything worked as expected and calling getAllFoos got me a list of Foo-objects.

So Far so good.

Now I wanted to add a new field to the Foo-object and that should contain an Enum. Easy peasy.

Now I need to update the database

That’s it!

When testing that though I found that it wasn’t because now everything blew up when calling getAllFoos ….

What happened?

Well, as expected the fetchAll tried to hydrate the values of the Foo object wth the values from the DB. But the DB contains a string whereas the Foo object expects the respective enum.

There is no out of the box solution to this. PDO has no idea how to convert this database-value into something the object understands (it could infer the expected enum-type from the type-hint but that can get out of hand rather quickly when it’s not an enum bot any other object that doesn’t have a ::from method or…)

Property Hooks to the rescue.

So I had to find my own way around this. And here property hooks are awesome when one has to adapt to legacy code.

So this is what my Foo class now looks like

Works like a charm now!

Content-Negotiation

A few years back I had a great live-experience regarding failed Content-Negotiation. I was sitting in Montreal in a restaurant waiting for the waiter. Once they came they asked me something in french and I immediately told them that I don’t understand french and whether we could speak english. We could. So I got a menu (in english and french) and a few minutes later they came back to take my order. And they talked to me – again – in french. So we had to go through the whole dance again.

What does that have to do with Content-Negotiation? Well: We did negotiate that we would communicate in english. Comming back to me with some language that we already had established I can’t understand doesn’t make sense. And I might just not understand what they want.

Continue reading Content-Negotiation

Happy Birthday PHP

Today is a very personal day that is deeply connected with the programming language thatI use most – I could even say “love”.

On this day 30 years ago a certain Rasmus Lerdorf made his Personal HomePage tools publicly available. The birth of a language that should change the WorldWideWeb – conincidentally invented by a person that celebrates their birthday on exactly this day!

In these last 30 days PHP has become the programming language powering the majority of public websites – ask 3 different surveys and you’ll probably get 4 different percentage values. But all of them state that PHP is the by far most used language.

PHP has reduced the entry barrier for (web) development significantly which is probably one of the most underrated things that PHP did for programming in those last 30 years.

And due to that a lot of people started programming and were able to throw together something that worked. A lot of those people in the early days had probably not a background in programming. They did a lot of things… differently. Probably even wrong. Which also led to a lot of security issues. Which is why to this day PHP has a bad reputation of being slow and insecure and is by a lot of people not considered a “real” programming language.

And so for 30 years now people are regularly referring to PHP as a “dead language”. But well… a creaking door hangs longest…

One of the things that also developed in these 30 years is a vivid community around the language.

I first came into contact with it in form of a mailing list in 2001. And little did I know where that would lead me.

It allowed me to learn programming – first by asking questions – soon realizing that I was even able to answer some of the questions. Which allowed me to dive deeper into programming in my first real job. Which brought me into contact with more and more people from the local community. It even introduced me to my local usergroup around 2011.

And from that point on there was no turning back. I was thrown into co-organizing our local usergroup. And I realized that it would be really awesome to be able to visit other usergroups. But there wasn’t a list of other usergroups. So … I had to scratch my itch and build a list, hadn’t I?

And gosh that exploded…

It brought me into contact with so many more amazing people and opened doors that I am absolutely grateful for! It even caused me to submit a talk to a conference because a fried I made via the usergroup-organizer chat thought I should. So in 2015 I got accepted and spoke for the very first time at a PHP conference. And suddenly I stood there beneath all those big names in the PHP-community – and it turned out they were mere mortals and we had a great time!

But – and here the sad part starts – 2015 was the year that my better half got diagnosed with cancer. And due to her chemotherapy (and a change in it that required a weekly dosage) she wasn’t able to join me in this experience.

She went through it and everything was fine again.

Until on this day 5 years ago. On the 8th of June. We got the diagnose that the bastard was back again!

And when I publicly wrote about it, the PHP community did again the for me unexpected. The wave of support that hit me was overwhelming. I still sometimes have trouble understanding it! But you are all amazing!

So celebrating 30 years of PHP for me is so much more than celebrating the birth of a programming language.

It is celebrating the birth of a community that carried the Personal Homepage Tools of some quirky greenland-born guy to one of the cornerstones of the WorldWideWeb and beyond.

It is celebrating a Community that has supported me in so many ways that I can’t describe.

It is celebrating a community that connects people from all over the world in a family-kind of way (Yes that also includes the odd uncle that will always pop up somewhere).

And personally I celebrate a community that has carried and supported me through 10 years of every now and then tough times. And that has brought me a lot of friendships that I do not want to miss!

Thank you Rasmus for sparking this!