u/jh_tech

▲ 0 r/PHP

#[Reaped]? #[Pooled]?

PHP 8.4 was a game changer for PHP, and not just syntactically. Lazy/ghost objects, and the ability to reset them, is the 1st real opportunity we've had to manage memory in long-running PHP.

Hot take: the more recent focus on functional and generics are just adding to the maintenance burden and moving the focus in the wrong direction.

Fluent method chaining and PHPStan get us most of the way there; the rest is a trade off for very little net gain.

Can we circle back and focus on what's already there -- what PHP8 through 8.4 already gave us?

Some example ideas:

`#[Reaped]` or `#[Pooled]`

Gives class memory back or frees it to be reused.

(ZMM challenges aside)

`#[Stacked]` or `#[Record]`

Stack-allocated objects, and the semantics to go along with it.

__lazy() and/or __ghost()

Provides a lazy/ghost constructor - likely providing helpful args passed in, respectively.

Easier said than done..I'm aware.

It seems the direction of the language is a bit ADD at this point though.

PIE is now finding its footing too.

With some thoughtful leverage and iteration, PHP could really find its own stride.. instead of becoming C#'s slower cousin. The '$' that embodies PHP spirit is slowly becoming '$$$'.

Rant over...thx for reading

reddit.com
u/jh_tech — 3 days ago
▲ 15 r/PHP

Phalanx - Managed Concurrency for PHP8.4+ & OpenSwoole 26

Phalanx is an altogether different take on async PHP.

It aims to address the foot guns and long-running PHP8.4+ memory curve head-on. The closest comparison I've seen is Kotlin's coroutine scopes.

I'm pre-alpha and just looking to drum up any support I can right now (solo dev, nights and weekends).

I have a TUI I test with which uses React idioms (e.g. `UI=f(state)`) and signals which I'm using to prove out the memory pooling approach I'll be using under the hood. The ability to reset lazy/ghost objects (memory pooling), a resource ledger for scoped lifetimes (or 'borrowed lifetimes'), and central scheduler (for cleanup) are all working together under the hood at this point. It's looking/testing great so far. Userland will see very little when it comes to these technicalities.

The org has many repos but this has been an ongoing project/concept of mine since 2024, so I've tinkered over time. Only a subset of these libs will make it in the alpha release - not too far off now.

Any support on the repo helps, thx guys

https://github.com/phalanx-php/phalanx

u/jh_tech — 6 days ago
▲ 2 r/mcp

Hello all,

I'm closing in on an alpha release of a new runtime context layer I've been making for AI agents - driven by MCP. It's fully open source.

I haven't tagged an alpha yet, I'm a solo dev with a full-time job and would appreciate any support/feedback I can muster. I use this system everyday, have for months now while I've been working on it.

https://github.com/daemon8ai/daemon8

u/jh_tech — 18 days ago
▲ 22 r/PHP

Curious what ya'll think here

https://phalanx-php.com/

This is an ongoing idea I've been building since late 2024. Nights and weekends, then AI really hit, so it's been a back burner for me, but I really think async PHP is full of untapped potential. Don't be surprised if you find bugs, Ive got a couple apps in prod that work great but it's been a lot of work/ground to cover - I'm interested in the POC so it's worth it:

E.g.

PHP AI lib:

https://github.com/phalanx-php/phalanx-athena

PHP dev server (w/buns help):

https://github.com/phalanx-php/phalanx-skopos

PHP Networking:

https://github.com/phalanx-php/phalanx-argos

UI (inertia with a twist, uses tanstack start/query):

https://github.com/phalanx-php/phalanx-eidolon

Some are very early development, likely best to ignore them:

Terminal

CDP

u/jh_tech — 24 days ago