@edorian@phpc.social avatar

edorian

@edorian@phpc.social

👋 I'm a magic __method();

Well, a Software Engineering and Management Human interested in Ops, growing systems, shipping, DX, PHP, etc.
Gaming enthusiast. He/Him.

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

edorian, to php
@edorian@phpc.social avatar

Is there a way to make 8.3 purely from within userland, without shelling out or using posix APIs?

I want to get some more testing done on 8.3 signal processing.

8.2 and below tostring and similar recursions worked:

class Crash
{
public function __tostring()
{
return "".$this;
}
}

"".(new Crash());

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

I finally found an occurrence of this beauty :

$this->$this

It still looks like a typo in the original code, but with the help of __toString, it works. Also, strict_types doesn't help here.

https://php-tips.readthedocs.io/en/latest/tips/this_this.html and more tips!

edorian,
@edorian@phpc.social avatar

@dseguy big fan. Thanks for sharing

edorian,
@edorian@phpc.social avatar

@dseguy I've done worse tbh. And some of it turned out to be a good idea for very specific circumstances.

Yet to find a sensible reason to use toString though.

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

Hey #PHP. When you use union and intersection types, do you include spaces?

(RT for reach, etc. This is survey data for @phpfig. If you know of any official policies by major projects already, please note/link in the replies.)

#codingstyle #phpfig

edorian,
@edorian@phpc.social avatar

@Crell @phpfig For me, somehow yes.

If there are no braces I know at the first symbol that it's a uniform list and that I can just go and skip-scan through the text.

But (ClassNameWithSomeLength|(Foo|Bar))&Baz type constructions are quite hard for me to parse visually.

Might be the |( and &( constructions. Unclear t.b.h., just noticed it's more of a strain.

Given how rarely such complex types happen I'm going to be fine either way :)

edorian,
@edorian@phpc.social avatar

@Crell @phpfig for everything that has more than a simple & or | chain having spaces is such an accessible thing for me, allowing me to parse the blob of symbols.

If my editor would highlight the braces and symbols differently from the text I would have more of a chance without spaces, but as it is, it's very annoying. Especially because they need to restate the compound types everywhere, not just define them once like in TS.

edorian, to random
@edorian@phpc.social avatar

One of the most exciting PHP projects just dropped their v2:

https://www.cspray.io/blog/autowiring-and-annotated-container/

I've been longing for modern, clean, fast and open DI in PHP for a while. And this is scratching an Itch I had nearly given up on.

(Yes SF-DI is making progress in a direction I don't hate as well, no you're not doing it wrong™ either way <3 )

cspray, to php
@cspray@phpc.social avatar

Couple weeks ago speaking with @ocramius about Annotated Container. He brought up something about Attributes I had heard a few times before. Something along the lines of:

"I don't want container wiring code littered throughout my codebase."

So, I wrote a blog article that talks about how Attributes aren't really the point of Annotated Container and how you can use the library with no Attributes or highly limit their spread through your code.

https://www.cspray.io/blog/annotated-container-without-attributes/

-container

edorian,
@edorian@phpc.social avatar

@cspray neat which specific negative experiences everyone made

I don't want a big garbage pile of central wiring code

Best case the code locally states what it should get injected in the default case, everything else is autowires.

For me services.xml/yml are the worst, services.php is bad and everything locally where the class is defined is something I found to be scalable and easy to work with for big teams across time.

edorian, to random
@edorian@phpc.social avatar

What's the easiest way in PHP to get the "Extended Grapheme Cluster" length of a string?

As in: What gives me 1 for the count/length of the string "🤦🏼‍♂️" ?

https://3v4l.org/TlN33

wyri, to php
@wyri@haxim.us avatar

New PC who this! Gave the @reactphp Hello World a quick benchmark, clocks in at nearly 70K requests per second with 100 concurrent keep alive connections on a single process:

edorian,
@edorian@phpc.social avatar

@wyri I was mainly wondering about the tool your using (ab, siehe, jmeter, etc) and if it's keepalive or not.

Not at my gaming PC at the moment but want to compare that as well :)

wyri, to random
@wyri@haxim.us avatar

I am a Dwarf and I'm:

edorian,
@edorian@phpc.social avatar

@wyri well done sir

Girgias, to random
@Girgias@phpc.social avatar

Happy Easter and Trans Day of Visibility from the Japanese mountains!

edorian,
@edorian@phpc.social avatar

@Girgias eeeegg

edorian, to random
@edorian@phpc.social avatar

🚢 Today I've pushed a couple of files containing the following:

%sailed to open stream: No such file or directory

Let me tell you why. 🏴‍☠️

We at Tideways collect errors for our customers in addition to performance data (if they want). We have extensive tests ensuring this works across all frameworks and PHP versions.

I was adding some tests for fopen warnings.

PHP 7.x: failed to open stream: ...
PHP 8.x: Failed to open stream: ...

So I've used the PHPT placeholder %s for that difference.

edorian, to factorio
@edorian@phpc.social avatar

Just finished a 2 player co-op run of with the mod set.

While my friend hasn't played much classic before we still decided to go for the more complex playthrough, and it worked out great.

145 hours to launch the rocket and so much fun refactoring. The mod set is in a really good state, good pacing, lots of options to build big or clever, meaningful differences in approached.

Can recommend! (We tuned off Bob's Greenhouse to make it a bit more challenging /interesting)

edorian,
@edorian@phpc.social avatar

@klimpong there are dozens of us.

It's a really fun game. Happy to talk more about it if you're curious

edorian, to random
@edorian@phpc.social avatar

I'm so happy that @bephpug is back.

A place for PHP people of all walks of frameworks and home grown structures.

I'll be giving a talk on strace, gdb, LD_PRELOAD and debugging beyond what APM tooling can tell you.

Come by if you're in Berlin? :)

https://www.bephpug.de/

edorian, to edge
@edorian@phpc.social avatar

News headlines I didn't ask for are the worst kind of ads for me.

Attention grabbing, hollow ragebait made to misinform and divide.

That's why I find it so odd when I see people use or in their default configuration.
The amount of paid content blasted in my face is something i can't really tune out, like others seem to be able to.

It works with ads, so I guess the same filters work with News when folks train themselves.

edorian, to random
@edorian@phpc.social avatar

My Fiber-Router from German Telekom is consuming over >300kWh (>100€) per year MORE than a FritzBox.

For no reason or benefit.

Impressive levels of waste

mgdm, to random
@mgdm@altelectron.org.uk avatar

Building a slightly daft webapp using 2000s spec JS techniques (lots of <script> tags, no bundling) has been pretty fun. Ditching the frameworks can be rewarding

edorian,
@edorian@phpc.social avatar

@mgdm HTMX has a lot of that feel for me

edorian, to random
@edorian@phpc.social avatar

Book-a-table style service with a method of bot detection that I haven't seen before.

edorian,
@edorian@phpc.social avatar

@rdohms opt in harassment, something only the humans would do

edorian, to random
@edorian@phpc.social avatar

Holy hell the overreliance on is coming back to bite UE5 games HARD.

2 is maybe the most extreme example I've seen.

TSR - Native / Medium

vs

DLSS - Quality / Medium

It's looks plain awful in motion

https://imgur.com/a/55FQiNQ

image/png

edorian, to random
@edorian@phpc.social avatar

In the PHP 5.3 days we had a couple use cases where we did object to array casts and used the var_dump($x["\0ClassName\0PropertyName"]); formatting to extract data.

(It was really fast compared to Reflection back then and it was for a good cause. I promise :P)

https://3v4l.org/Sk0Iu

Today while chatting with @beberlei about those times I was reminded that in 7.4 https://www.php.net/manual/en/function.get-mangled-object-vars.php was introduced.

Totally missed that at the time. Good memories!

Have you ever used this, and why? :)

phpc, to random
@phpc@phpc.social avatar

Hi, instance folks!

Thank you so much for your generosity in supporting this service. We hope you find it beneficial.

Currently, our monthly expenses are higher than monthly contributions. Thanks to one-time donations, we have reserves that allow us to operate like this, but we will eventually run out.

Please consider signing up for a recurring (monthly or yearly) contribution to ensure we can keep this service running.

Details are here: https://opencollective.com/phpcommunity/projects/phpc-social

edorian,
@edorian@phpc.social avatar

@phpc

Thank you!

edorian, to php
@edorian@phpc.social avatar

Back from vacation and excited to announce that we, over at , now fully support

https://www.linkedin.com/posts/tideways-gmbh_frankenphp-activity-7191031503009587202-qUFj

It's great to see the ecosystem grow and prosper and I believe proper tool support and performance insights will only help when it comes to choosing the right tool for your job.

It's been a bit of a struggle getting everything to work for me, but thanks to our C specialists all the test scenarios I wrote along the way are now passing, including

edorian, to random
@edorian@phpc.social avatar

Had a good chat about https://wiki.php.net/rfc/property-hooks with a colleague today.

Happy with the result. Looks like PHP, leaves options to address future issues. Great first step.
Excited about the potential performance gains.

If I'd have voting rights* I'd vote yes wholeheartedly.

Big thanks to the authors! I can imagine this wasn't an easy discussion.

--
*Don't think I should have voting writes, I do PHP and C-Extensions, not core and I'll comment when I have user-land feedback, but that's enough.

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