
Senior Director of Backend Development at @TradingView. Certified AWS Software Architect. Author of the Go! AOP and Z-engine frameworks.
Cyprus
Joined October 2010
- Tweets6K
- Following427
- Followers1.1K
- Likes2.3K
Really curious what is behind the @Revolut outage. I cannot even login in their app.
Almost 30 sub-systems partially broken. I can bet, that problem of such a size only possible due to human errors and lack of ITGC processes in place. This can be one of certificates or private key re-issued or untrusted because of legal entities split.
Hmm, another possible scenario is outage of GCP: status.cloud.google.com/regi… where Europe-west-2 region in London is disrupted in all services. Still, why don’t you have cross-regional redundancy/sharding to keep services operational?
Reified #generics in #PHP, in userland, with no php-src patch. Here's how z-engine makes it possible.
Box::of('int') doesn't return a wrapper or a validator. It returns a real class, Box, registered in the engine's class table. The Zend Engine itself throws the TypeError, the same one a hand-written class would throw.
How it works:
Z-engine reaches the engine's C structures from plain PHP through FFI. Its ClassSpecializer deep-clones the template's zend_class_entry under a new name and rewrites the zend_type of every property, parameter and return type. The compiled method bodies aren't copied. They're shared through the engine's own op_array refcount.
That's why the memory numbers are interesting. A 32-method specialization costs 34,448 bytes whether each method has 4 statements or 200, identical to the byte. Generating and compiling the equivalent concrete class costs 22,480 and 399,312 bytes. "Monomorphization costs too much memory" is the usual argument against generics in core, and now there are real numbers to discuss.
What surprised me:
• Rewriting a type isn't the same as enforcing it. Property writes read zend_property_info and return checks read arg_info. But plain parameter checks use a type mask the compiler cached in the RECV opcode, so that mask has to be patched too.
• A specialization is a sibling of its template, not a subclass: $intBox instanceof Box is false. Type-hint an interface instead.
• The name Box is deliberate. No PHP source can declare a class with < in it, so it can never collide with a real class, and it still reads well in stack traces.
Cost: creating a specialization takes ~220µs plus ~150µs per method, and fetching an existing one takes ~2µs. Method calls run at parity with hand-written classes. The one exception is class-typed property writes, which cost about 2x.
It runs on PHP 8.4 and 8.5, plus 8.6 beta. There's also a PHPStan extension, and a test suite that runs on --enable-debug builds so memory corruption surfaces as an assertion failure.
It's experimental, so not for production, but it shows PHP's engine is far more flexible than its syntax.
github.com/lisachenko/userla…
github.com/lisachenko/z-engi…
#PHP #Generics #PHPInternals
Once my z-engine started to work on PHP8.6, I’ve prepared the userland PHP generics on Zend engine level for PHP8.6 too! github.com/lisachenko/userla…
After several fixes of Tailcall VM for PHP8.5/8.6, I’ve managed to receive green CI pipeline for a new version of my Z-Engine for upcoming PHP8.6!
And framework has received an ability to preserve original method/function code during the redefinition of existing PHP class methods github.com/lisachenko/z-engi…. Useful for AOP or for long-running process managers - just swap one PHP method with another one.
Why is gold yellow? 🪙
Surprisingly, Einstein has something to do with it.
Gold has 79 protons, so its inner electrons move fast enough for relativistic effects to matter.
Relativity shifts gold’s electron energy levels, making it absorb blue light more strongly.
The remaining reflected light looks yellow.
Without these relativistic effects, gold would look much more like silver.
So the color of gold is, quite literally, a visible consequence of Einstein’s relativity. ✨
🤖 Made with AI
goaop/parser-reflection 5.0.0 is out 🚀
Early release with PHP 8.6 reflection parity — before PHP 8.6 even ships:
✅ partial function application
✅ readonly property defaults
✅ isReadable() / isWritable()
✅ parameter doc comments
All static. No class loading.
github.com/goaop/parser-refl…
Thing that I’m proud of: tradingview.com/mcp/docs
We have launched the official TradingView MCP server for paid subscriptions! At the price of just one lunch you will have access to high-quality financial data, which can be used by agents to make proper decisions!
For terminal lovers: do you agree that AI agents will start soon register themselves as default shells in OS? I’m observing that I’m opening terminal just to launch my favorite agent in working directory and then continue fully inside agent terminals. @bcherny
PS sometimes I still need git tagging/misc calls, which are not exposed as MCP tools yet.
Alexander Lisachenko retweeted
#PHP 8.6 turns on three session settings that should have been default 20 years ago. 🔐
session.use_strict_mode goes from 0 to 1, so the engine REFUSES a session ID it never issued. That flag kills session fixation.
session.cookie_httponly goes to 1 and session.cookie_samesite becomes "Lax".
RFC session_security_defaults, by Jorg Adam Sowa. Custom handler? Implement validateId().
PHP 8.5.10 released - 34 fixes in 19 components.
Changelog + downloads: php-net.pro/news/php-8-5-10-…
For anyone, looking for the replacement of the adlawson/vfs package, there is PHP8.4+ version now, recreated with Claude github.com/goaop/virtual-fil…
Replying to @OndrejMirtes
@OndrejMirtes have you tried to run Claude remote environment sessions? I’m hitting the same wall multiple times that phpstan is not available for agent: “The blocker is phpstan/phpstan — a dist-only package whose zipball lives on api.github.com (403 through the proxy).”
It is always funny to see posts about “dying #php”. Still there. Still works. Still alive.
🤖 Made with AI
Alexander Lisachenko retweeted
Every C value FFI hands back is the same final class, FFI\CData — so no static analysis, no IDE types, instanceof can never work. @lisachenko wants an opt-in classmap, in the shape SoapClient already takes. @bwoebi: don't rush it, write an RFC.
Check it out: github.com/lisachenko/z-engi… Release that I’m proud of. Impossible without heavy Claude work on it, guided by my requests.





