asgrim, to php
@asgrim@phpc.social avatar

I'm on a plane!! Boarded first short hop MAN ✈️ LHR en route to what will be the epic-est PHP conference in Austin TX - @longhorn PHP🤘

Much excitement abound! Can't wait to meet you all and talk about the @roave Discord, and maybe you can hire us too 😘

➡️ https://discord.gg/Roave

ramsey, to php
@ramsey@phpc.social avatar

My kingdom for public properties defined on interfaces.

ramsey, to php
@ramsey@phpc.social avatar

I decided to play around with the AT Protocol, so I put together a very rough & very early #PHP library to play around with the concepts.

If you're interested, check it out, & I'd love to have others contribute to round it out and make it full-featured.

Ultimately, I’d love this library to be a starting point for working on some #ActivityPub / #ATProtocol bridging.

https://github.com/socialweb-php/atproto

nyamsprod, to php French
@nyamsprod@phpc.social avatar

I wish #PHP had two things and none of them involve generics... I wish it had type aliases and a native base32 encoding/decoding mechanism (in a class or a pair of functions I do not care)

kboyd, to php
@kboyd@phpc.social avatar

I'm sure a number of folks on this instance have heard of The PHP League (aka The League of Extraordinary Packages) https://thephpleague.com/

But tell me - which packages do you use (or that you've used in the past)? What do you like about them?

#php

dseguy, to php French
@dseguy@phpc.social avatar

😂 This made me chuckle... welcome to 8.3 !

First array is the type, the second is the name of the constant, with the relaxed keyword, and the last one is the value of the array.

Crell, to php
@Crell@phpc.social avatar

Please, web app developers, consider how your users will upgrade. If your upgrade process is "remove the old one, unzip the new one", then it's not an upgrade process. It's an encouragement to never upgrade.

#PHP #Laravel #Programming

brunty, to php
@brunty@brunty.social avatar

folks, what framework-agnostic tooling (as in not / / etc) are you using for running headless browser-based tests these days via something like ?

I'm looking at setting something up in on , I've tried Symfony Panther and it's been a shitshow of errors and not being able to get or running in Docker :/

cory, to php
@cory@social.lol avatar

If the only #PHP I’ve written has been in the course of forcing Wordpress edge cases to work, how would one suggest getting started with #Laravel? (I write a lot of #Javascript but don’t necessarily want to write it on the server).

musicmatze, to php

I am currently thinking about learning new programming language ecosystems and skills.

My current thoughts about #php - can one earn decent money with #php nowadays?

What does the php community say? What learning resources should I check out (for those unaware: I am a professional Rust dev and have >10 years experience in programming - no need for a beginner tutorial).

syntaxseed, to php
@syntaxseed@phpc.social avatar

It's interesting to read an article which criticises the #PHP community-based committee governance model.

Because the argument boils down to 'design by committee rarely achieves excellence'.

But what's missing is, who defines "excellence"? A BDFL might achieve more for their goals, but anyone who wants something else is told 'too bad, so sad'.

PHP is a generalist web language. A governance committee ensures diversity of goals & a more broad evolution of the language.

https://stitcher.io/blog/limited-by-committee

matdevdug, to rust
@matdevdug@c.im avatar

I am baffled by how much trouble I’m having at writing #rust at a decent clip. #Golang I felt pretty good at after a few months, same with #Python and #PHP. Meanwhile I’ve been trying to write anything useful in Rust for months and it’s so incredibly slow going.

I’m shocked people are enthusiastic about adopting this for their jobs. If I had a specific part of an app that needed more speed, absolutely. But as a general purpose language? I’m not seeing it yet.

I’ll keep ramming my head against it but have not enjoyed myself thus far. If writing a proof of concept in python takes me 4 hours, rewriting that in rust clocks in easily at 12-16 hours.

ramsey, to random
@ramsey@phpc.social avatar

I can get #PHP’s RecursiveDirectoryIterator working by passing it to RecursiveIteratorIterator and looping over it, like here: https://3v4l.org/ll176

But I can’t seem to figure out how to get this working with RecursiveCallbackFilterIterator. From my understanding, this should have the same output as the example above, but it’s not even looping because $contents->valid() is returning false. https://3v4l.org/MM7kZ

What am I doing wrong?

outofcontrol, to Laravel
@outofcontrol@phpc.social avatar

Saw this on the #Laravelshift newsletter (admit I mostly signed up for tips at the bottom), and looks like Jason doesn’t post on Mastodon… yet :) so posting here. Have to admit, I’ve had a hankering for something like a .laravel file a few times now.

#laravel #php

the_halmaturus, to php Esperanto

Need some help to get a PHP / Postgresql thing fixed.

I am running on debian 12 and have installed postgresql, php and pdo psql. Additionally I created the needed user and database for ulogger.

I can connect with the user / pw with dbeaver and see the empty db.

Unfortunately PHP does not believe it can handle the Postgresql DB and claims in the Error message: "could not find driver"

Packages installed are:
• apt install postgresql
• apt install php
• apt install php-json
• apt install php-fpm/stable
• apt install php-pgsql/stable
• apt install postgresql postgresql-client

Any idea what I could have done wrong or which step is missed?

Thanks in advance, for any help on this question.

​:boosts_ok:​

Crell, to php
@Crell@phpc.social avatar

Is there a function that would help replace or simplify a function with this description?

Creates a subarray from a given array based on a set of selected fields

@param $existingArray
eg: ["name" => "John", "age" => 25, "address" => ["city" => "New York", "zip" => "10001"]];

@param $selectedFields
eg: ["name", "address" => ["city"]];

@return

  • eg: ["name" => "John", "address" => ["city" => "New York"]];

It feels screwy, but I'm not sure what the better alternative is.

Crell, to php
@Crell@phpc.social avatar

Let's be controversial: In modern , you should never type-hint an array.

https://peakd.com/php/@crell/php-never-type-hint-on-arrays

pilhuhn, to php
@pilhuhn@mastodon.social avatar

#PHP seems to have some fan-boys out there ;-)

Or a big vulnerability…

hennell, to RegEx

This is pretty neat. A better way to in ? 🤔

https://github.com/gherkins/regexpbuilderphp

Crell, to php
@Crell@phpc.social avatar

The merging of sequences and maps into a single structure in has cost me many hundreds of hours and innumerable bugs over my career. It is still doing so now.

"Arrays" are PHP's original sin.

Edent, to php
@Edent@mastodon.social avatar

🆕 blog! “Should the WordPress scheduler use datetime-local?”

There's a brilliant post by WordPress about how they've optimised some of the backend code to make it more efficient. So here's a suggestion for something else which can be optimised. If you want to schedule a blog post to be published later, you have to use this WordPress control: I find it mildly an…

👀 Read more: https://shkspr.mobi/blog/2023/09/should-the-wordpress-publish-scheduler-use-datetime-local/

timwilson, to php

I've got a PHP website with a PostreSQL backend. It's entirely read-only in production, and its largest table has about 10,000 rows. Postgres, PHP, and a Caddy proxy all run in separate Docker containers.

Is it crazy to think that a simple system like this would run just fine with SQLite instead? In the longer term I’d like to move the whole thing to running with the Django Rest Framework and rework the front-end bit entirely.

Crell, to php
@Crell@phpc.social avatar

Training exercise:

Try to replace all $foo->isBeep()/$foo->canBar() etc. calls with an instanceof check. $foo instanceof Beepable, $foo instanceof Bars, etc.

What does that do to your data model? If you leverage parameter types instead of manual instanceof checks, how does that simplify your logic flow?

I don't expect it to work for every use case, especially in PHP, but it would be a valuable exercise to try.

alda, to wordpress
@alda@topspicy.social avatar

Things that are built into WordPress but receive little-to-no use:

  1. Hello.php and an upsell of Akismet
  2. Blog posts
  3. Comments
  4. Dependency on an external service for profile pictures

Things that aren't built into WordPress but should be:

  1. Multiple authors per post
  2. A form builder for wp-admin
  3. An ORM that prevents n+1 queries
  4. Modularity via composer packages
  5. Bucket storage support

Crell, to php
@Crell@phpc.social avatar

Proposal for a conference talk: How to configure and all its tooling extensions (xdebug, phpstan, php-cs-fixer, etc.) to use a docker container consistently.

That could easily fill a tutorial...

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