@Girgias@phpc.social avatar

Girgias

@Girgias@phpc.social

I'm a PHP core developer and documentation writer, funded by https://phpc.social/@thephpf
Lead maintainer, and master of typos, for the French translation of the PHP documentation.
BSc in pure mathematics
Photograph/Otaku in my spare time

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

sji, to random Japanese

Some days ago I came up with an exciting hack to get the address of _tsrm_ls_cache for running ZTS threads from outside the process without an unstripped PHP binary (via brute forcing), but I haven't had time to try it yet...

Girgias,
@Girgias@phpc.social avatar

@sji Oh boi that sounds spicy

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

@derickr @Girgias I have updated my Draft RFC for base32_encode/base32_decode. Let me know what you think about the new proposal.
https://gist.github.com/nyamsprod/8a5cf21c136952a46ec8836f29738c82

Girgias,
@Girgias@phpc.social avatar

@nyamsprod @derickr Makes sense to me :)

jessie, to random
@jessie@mastodon.social avatar

This is terribly immodest but if you're organizing a conference I've got a funny and chill developer focused, keynote-ready talk about AI data and consent that I'm annoyingly pleased with.

Even redoing the slides to make them cuter to offset the doom.

Girgias,
@Girgias@phpc.social avatar

@jessie I can certify, it is a good keynote!

Girgias, to random
@Girgias@phpc.social avatar

BREAKING NEWS:

A whole new way to determine canonical tag names has dropped:
https://www.tumblr.com/suiker/743344409506119680
/s

inthehands, to random
@inthehands@hachyderm.io avatar

What are programming language in widespread use today that:

  1. have declared types, but
  2. types are only checked at runtime, no static type checking?

I believe you can make Racket do this, and it’s an idiom with old Scheme roots. I think? And don’t some dependently typed languages resort to runtime checks when static proofs aren’t possible?…but I’m looking for no static types, runtime checks only.

Girgias,
@Girgias@phpc.social avatar

@itsjoshbruce @inthehands @ramsey @Crell Yes, type declarations are optional and checked at runtime, opcache/the optimizer might remove the type checks if it can determine the type of the value is already valid (AFAIK this only happens for return values and return types)

strict_types is weird, and I wouldn't say it overrides the type juggling behaviour, as it only affects the function context [1] and not everywhere type juggling happens.

[1] Slide 65 of my talk: https://gpb.moe/doc/slides/PHP_Type_System_Talk_PHPUK2023.pdf

Girgias,
@Girgias@phpc.social avatar

@w96k @itsjoshbruce @inthehands @ramsey @Crell What does "strong" typing mean?

If it is less stupid type juggling sure, if it is no type juggling, then no.

I still think it is extremely convenient and valuable that numeric strings just work.

PHP would also not be where it is if was asinine about typing, IMHO. It is easy to pick up for a reason, and PHP's runtime type checking already makes it a nicer experience than dealing with Python IMHO.

Girgias,
@Girgias@phpc.social avatar

@Crell @w96k @itsjoshbruce @inthehands @ramsey I wasn't there when it happened, but like the proposal from Zend at the time to make the coercions stricter was hella sensible. And I still don't get why this didn't get accepted.

strict_types was a bandage, and a really really good one, but at the end it is still a bandage. And we are tackling the issues 5-8 years later when most of this could have been solved with PHP 8.0 already. :|

Girgias, to tea
@Girgias@phpc.social avatar

I must say the Marco Polo Blue #tea from Mariage Frères is probably my favourite one.

grmpyprogrammer, (edited ) to random
@grmpyprogrammer@phpc.social avatar

The head of Automattic being transphobic puts a stain on the WordPress community.

Girgias,
@Girgias@phpc.social avatar

@sarah @grmpyprogrammer He's been having a public meltdown: https://www.tumblr.com/poop-shitter/742854661481037824

Edit: been witnessing this on the sidelines for a couple of days already as a friend of mine is way more active on Tumblr

peterrowlett, to random

My 8yo: What’s 2 times pi?

Me: Well pi is three-and-a-bit, so 2 times pi would be six-and-a-bit.

Him: Six and two bits.

Me: Yes. Six and a bigger bit.

Him: Can you think of a number in the pi times table that’s a whole number?

#tmwyk

Girgias,
@Girgias@phpc.social avatar

@peterrowlett Can you use pi times 0 for a cheeky answer?

Girgias, to random
@Girgias@phpc.social avatar

Currently, in the process of doing some MAD SCIENTIST shit.

Stay tuned /s

timotheegoguely, to php French
@timotheegoguely@mastodon.design avatar

Besoin d'aide en PHP : dans le code ci-dessous, est-ce que quelqu'un sait à quoi servent les 2 points d'exclamation de part et d'autre de preg_quote($query) ?

$matches = preg_match_all('!' . preg_quote($query) . '!i', $value, $r)

Le premier paramètre de preg_match_all c’est le pattern regex, mais je ne comprends pas à quoi sert de le délimiter par des !, j'ai plutôt l'habitude de voir des / en général… 🤔

#PHP

Girgias,
@Girgias@phpc.social avatar

@timotheegoguely Tu peux utiliser n'importe quel symbole pour délimiter une regex.
Utiliser un slash quand t'as regex fait des trucs avec des protocoles peut être relou.

Si t'as envie tu peux délimiter avec ~ un / un @ etc. :)

isotopp, to random German
@isotopp@chaos.social avatar

https://blog.koehntopp.info/2024/02/19/python-slots.html

In which I try to understand Python slots.

I find that dict is not really worse than slots, which is unexpected.

I also compare Perl, Python and PHP, and find that Python is slightly better than Perl in memory usage per object, which is impressive.

I also find that PHP uses as much memory as I would have Python dict expected to use, but Python optimizes this – PHP does not.

Girgias,
@Girgias@phpc.social avatar

@sebastian @isotopp That wouldn't solve the underlying memory consumption.
As dynamic properties are stored in a backing HashTable and those are only allocated in powers of 2 starting with a minimum of 8 elements.
So effectively the 20 dynamic properties take the same space as 32.
An issue that does not happen if all the properties are properly declared (although that's not a custom dictionary any more).

I'd guess that extending from stdClass should also be quicker as it has special handlers

Girgias,
@Girgias@phpc.social avatar

@Alister @isotopp @nikic stdClass has efficient __get and __set methods written in C and also doesn't require the attribute to suppress the deprecation.

So that's the main optimization I'm thinking about

Girgias,
@Girgias@phpc.social avatar

@isotopp @Alister @nikic @sebastian You could iterate over the keys of get_object_vars($this) and set all the properties in a foreach loop.

If the default values were constant time evaluable you could also use constructor property promotion to make the code less verbose.

Girgias,
@Girgias@phpc.social avatar

@isotopp @Alister @nikic @sebastian PHP do be a bazar at times with the functionality it provides! :D

thgs, to random
@thgs@phpc.social avatar

@Girgias thanks so much for uploading the talk. I wanted to join but had to follow with the others that I was with.

Went through the video and the slides and as kept having an issue with my properties being not initialized, took a couple of hours to figure out the arginfo was not correct as I was missing the constructor definition from the stub. Had a laugh when I figured it out.

Thanks so much for the talk though, that was great!

Girgias,
@Girgias@phpc.social avatar

@thgs Glad you enjoyed it!

MegaMichelle, to rust
@MegaMichelle@a2mi.social avatar

So, I'm just messing around, trying to learn Rust. I'm used to making web apps in PHP, or occasionally Javascript or Python. I'm trying out Rust with the Axum framework. I'm finding it to be a lot less ergonomic than doing the same type of stuff in PHP.

Is that just how it is? Like, I shouldn't be comparing it to PHP, I should only compare it to C++ or Java? I have no doubt that it's more ergonomic than those.

#Rust #PHP

Girgias,
@Girgias@phpc.social avatar

@MegaMichelle Rust and PHP are very different languages.

And I also don't think Rust is really suited for web dev, as what it brings to the table is very different from what PHP (which came out as a need to make websites easily) brings to the table.

ramsey, to random
@ramsey@phpc.social avatar

I’m looking for recommendations for books on graph theory. I’d like something that’s a good balance of academic theory and practical application, not too much one way or the other. (But, at the same time, I want it to go pretty deep into the topic.)

Girgias,
@Girgias@phpc.social avatar

@ramsey I could send you my graph theory notes which were really approachable in my opinion but it's way more theory than comp sci graph theory

rob, to random
@rob@akrabat.com avatar

At Finch’s with these reprobates @GeeH @asgrim

Girgias,
@Girgias@phpc.social avatar

@rob @GeeH @asgrim just got out at Moorgate and heading to the hotel, still there or moving to the jagged hare?

uberbrady, to random
@uberbrady@uberbrady.com avatar

Unpopular set of “the emperor has no clothes" opinions -

Stop using React for everything. It's a great tool. But sometimes a form just needs to be a form. Just stop.

Stop using Kubernetes for every systems thing. If you know the software you're hosting, and you can write a Dockerfile for it, you can just host it on bare metal. Don't carry around unnecessary abstractions.

Girgias,
@Girgias@phpc.social avatar

@uberbrady > the purpose of abstracting is not to be vague, but to create a new semantic level in which one can be absolutely precise.

Edsger W. Dijkstra

https://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html

Girgias, to random
@Girgias@phpc.social avatar

Damn #AirCrashInvestigation season 24 starting with an absolute banger of an episode with Ethiopian Airlines 302 (i.e. the Boing 737 MAX MCAS failure)

Girgias, to random
@Girgias@phpc.social avatar

I must say writing slides with @typst is such a breeze compared to LaTeX, I don't need to fight every 3 seconds with Beamer to not break when writing verbatim/code.

The fact I can just set the language for every code sample on one slides which differs from the norm is sooo nice.

Girgias,
@Girgias@phpc.social avatar

@Pol @typst Polylux as that's the first one I came across and it supports the Metropolis Beamer theme that I used to use :)

But it feels like I'm not really using any features of it rn because all my slides don't use pause or uncover lol

michabbb, to php German
@michabbb@vivaldi.net avatar
Girgias,
@Girgias@phpc.social avatar

@michabbb Invokable classes are far from the best option IMHO.

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