TypePHP now has non-interruptible audit report mode.
▲ 9 r/PHP

TypePHP now has non-interruptible audit report mode.

Hello r/PHP.. I'd like to share that TypePHP has now non-interruptable audit report mode and warning mode. Previously When you hit a type violation, TypePHP will halt the exeuction wih TypeErrors and causes scenarios where an App failed to boot during test because theres a type violation at the beggining of framework/library bootsraping.

Now you can have one pass audit mode to collect all TypeViolations in a structured JSON file instead of throwing so you can triage your codebase with more surgical fixes and eliminate docblock type lies that SA tool misses.

You can try this new feature now on the playground without installing anything..

Relevant docs: https://typephp-php.github.io/docs/core-concepts/violation-reporting

u/rc0604 — 5 days ago
▲ 19 r/PHP

From Sluggish to Blazing Fast: How I Made TypePHP 90x Faster and Uncovered 1000+ 'DocBlock Lies' on Shopware 6

TL:DR: Static analysis tools are fantastic for IDE hints and catching syntax bugs, compile time type errors in CI, but you still need runtime verification to guarantee end-to-end type safety against dynamic payloads, compiled DI containers, and database hydrations. And PHP is not slow, its a fast language..

typephp-php.github.io
u/rc0604 — 2 months ago
▲ 3 r/webdev

I just wanted to share my open source project (You can now do Reified Generics in PHP)

Hello guys, I just wanted to showoff my project here. For you PHP devs out here, You can now type check Docblock types at runtime. Yes this means you can now do reified generics, type-arrays, and many scalar type refinements without introducing new custom syntax and functions. You can now ensure that your docblock types will not lie at runtime and this is a great boost to cover static analysis tool's weaknesses.

repo: https://github.com/typephp-php/typephp
docs: https://typephp-php.github.io/docs/

PS: Yes I know the project's name is similar to other TypePHP from swoole if you're aware. But this project is really into improving PHP's type safety. It's like TypeScript but for enhance runtime type checking that PHP native type checking is all about.

u/rc0604 — 2 months ago

I just wanted to share my open source project

Hello everyone how's your weekdays? I just wanted to share my open project named TypePHP its about Type checking docblock types at runtime. it brings generics, type arrays, etc. You can do it effortlessly without any changes to your codebase. If you use Static Analysis Tools like PHPstan then I think you're gonna love this project.

If you're aware, this is very different from the chinese swoole team's 'TypePHP 'project that has nothing to do with making PHP types better and just making it another compiled language. This one actually focus in bring reified types to PHP and improving Type safety in PHP..

For those curios check the repo and the doc site here:

https://github.com/typephp-php/typephp
https://typephp-php.github.io/docs/

PS: Let's support Filipino Open Source Spirit and Community. If you have any open source project share it and let's help each other.

u/rc0604 — 2 months ago
▲ 13 r/PHP

Enforce Runtime Generics on Third-Party Collections Libraries (Doctrine, Ramsey, Laravel Collections) with TypePHP

More than a week ago, I posted an introduction to TypePHP. Thanks to Michael Telgmann, a core maintainer at Shopware, TypePHP has been tested against Shopware’s massive codebase. So far, it has identified many DocBlock lies in the codebase PR, while also uncovering many edge cases on TypePHP’s end.

Today, I’d like to share a article guide on how to make existing third-party collection libraries, such as Doctrine Collections or Ramsey Collections, capable of enforcing reified collections without modifying their source code.

reified generics proof: Symfony Integration

typephp-php.github.io
u/rc0604 — 2 months ago
▲ 15 r/PHP

TypePHP: Transparent runtime type enforcement for PHPDoc generics, type arrays, and scalar refinements in pure PHP

Hello Everyone I just written a pure PHP library for actually checking docblock types at runtime similar to Phyton Beartype but without using any custom syntax like decorators or attributes.

With this library you can finally type check docblock generics, type-arrays, and many more with just plain docblocks at runtime. I know I cant post images to this sub so here's an image proof upload in imgur:

https://imgur.com/a/4IBefOQ

Correct me if I'm wrong but there's no PHP library in userland that able to transparently check docblock types at runtime so I can proudly say this library is the first. Any questions and feedbacks are welcomed.

Link to the repo: https://github.com/typephp-php/typephp
Link to docs site: https://typephp-php.github.io/typephp/

I know there’s an upcoming proposal for reified generics, but I doubt it will provide fully featured generics or type arrays if it get accepted by majority of internals.

PS: I know there’s another upcoming project called “TypePHP” from the Swoole project, but they haven’t provided a license or made any copyright claim on the name. So, I think I can use this name without any problems, right? If not, I may change the project name in the future.

u/rc0604 — 2 months ago

No way!! Just got free 6 months free claude max subscription from my open source project

https://preview.redd.it/85aidrkza4eh1.png?width=1156&format=png&auto=webp&s=bb83a120e1bbd252c67c96c46b82bc655496174e

Just wanted to share some good news.. My HiblaPHP project was accepted into Anthropic's Claude for Open Source program, which includes 6 months of Claude Max for free.

I honestly applied just to see if the project would qualify, so I was pleasantly surprised when it got accepted. It's really encouraging to see more support for open-source maintainers.

If you're curious, check out the project here: https://github.com/hiblaphp/hibla

I love to see more Open Source projects flourish in our country..

reddit.com
u/rc0604 — 3 months ago
▲ 149 r/PHP

The PHP Polling API RFC is currently passing 19-0 and it might be the most impactful thing to happen to PHP in years and nobody is talking about it

PHP is about to reach its fullest potential for scaling natively and almost nobody noticed.

The Polling API RFC is currently in its voting phase with 19-0 and zero opposition as of the time of writing this post, while the community was busy debating generics. It brings native epoll and kqueue to PHP 8.6 core, which means async libraries like AMPHP and ReactPHP finally get a proper high-performance foundation without relying on PECL extensions.

I wrote a deep dive on why I think this is the most impactful thing to happen to PHP since types were introduced in PHP 7. I'm the author of HiblaPHP, and I will be rewriting its core Event Loop the day this RFC merges into PHP core.

link to the rfc: https://wiki.php.net/rfc/poll_api

medium.com
u/rc0604 — 5 months ago
▲ 75 r/PHP

Polling API RFC is now in voting phase

This RFC is now in the voting phase. Lowkey, it could have a massive impact on PHP, especially by bringing more modern backend stream handling. It would also replace stream_select() and make async PHP libraries far more viable without relying on extensions like ext-uv to bypass file descriptor limitations and O(N) performance.

wiki.php.net
u/rc0604 — 5 months ago
▲ 6 r/PHP

Building High Performance Self Healing Process Pool with Hibla Parallel

Hello everyone, I just wanted to share a past article I wrote about this topic. I’d love to hear your thoughts, feedback, or any questions you may have.

medium.com
u/rc0604 — 5 months ago
▲ 19 r/PinoyProgrammer+1 crossposts

Hibla Postgres: A pure non blocking PostgreSQL client for PHP is now available in beta release.

Hello everyone! I'm excited to announce that hiblaphp/postgres, built on top of ext-pgsql, is now available in beta, fully tested and can now be installed via Composer.

With this release, the core database drivers for Hibla are now complete alongside the Hibla MySQL client. My next goal is to build an asynchronous query builder with support for migrations and pagination before moving on to developing an HTTP server.

Some of the key features currently included are:

  • Fully non-blocking query execution
  • Name parameter and Positional parameter binding support like "?" and ":name" for prepared statements
  • Server-side query cancellation
  • Pub/Sub event-driven notifications with auto-reconnect support
  • Streaming support
  • Connection pooling

I'd really appreciate any feedback, whether it's feature suggestions, questions, or even harsh criticism. Every bit of feedback helps improve the project.

github.com
u/rc0604 — 5 months ago
▲ 0 r/PHP

What are your thoughts on this?

What if, as a compromise, a generics implementation in PHP supported optional runtime enforcement through a php.ini configuration, similar to how assert() works with zend.assertions? This would provide the best of both worlds: runtime generics during development for stronger validation and debugging, while still allowing static analysis tools like PHPStan and Psalm to handle compile-time type analysis and developer tooling. In production, the runtime checks could be completely erased for maximum performance.

reddit.com
u/rc0604 — 5 months ago

I got my first sponsor in my open source project.. Medyo nakakatawa nga lang

Hello I'm the Author of [HiblaPHP](https://github.com/hiblaphp), I just wanted to share that after weeks that I publicly announce my open source project in public social media's, nakaakit na rin ng sponsor. I'm so thankful to anyone here who believe and starred my project at sa bagong company sponsor. I hope this foster Filipino spirit on OSS. If anyone interested in contributing to the project feel free to submit issues and pr..

Ps. Medyo nakakatawa ngalang pangalan ng company sponsor na nakuha ko at parang minalas naman hahaha..

u/rc0604 — 5 months ago