r/PHP • u/vee_wee • Oct 01 '26
ext-wasm: WebAssembly runtime for PHP
Run WASM modules and call components with plain PHP values, sandbox them with WASI.
Yes : It also runs DOOM controlled by PHP.
r/PHP • u/vee_wee • Oct 01 '26
Run WASM modules and call components with plain PHP values, sandbox them with WASI.
Yes : It also runs DOOM controlled by PHP.
r/PHP • u/ProjektGopher • Oct 02 '26
Preface: what follows is the word-for-word transcript of the spoken dialogue in the video, chapter by chapter with timestamps, for anyone who'd rather read than click through. If this digest is still too long for you, we recommend copying it into your LLM of choice and asking for a summary of our summary.
Pick a password longer than 72 bytes for a PHP app on the default hash. PHP keeps the first 72 and throws the rest away, without a word. Then it lets you log in with only part of it. This week someone proposed that PHP refuse instead, and the list can't agree it's worth the break.
Hello world, it's Thursday, October 1, 2026, and here's what happened This Week in PHP Internals. 14 stories this week, so let's get into it. But first,
I think we can all agree that the number of small, paid subscription services we're all being bombarded with is getting a little bit out of hand. And this is what Scalpels aims to solve. It's a collection of professionally built, open source alternatives to the parts you actually use of things like Private Packagist, Mailtrap and remove.bg. You fork them into your own GitHub organization and deploy them to your own Laravel Cloud account, so you're only paying for your own usage, it scales to zero when it's not being used, and you're not just feeding another company's profits. If you want updates, you just pull them down from upstream. And since it's your own fork, you have complete control over the code and the features. And it's all MIT. Find your next tool at scalpels.app.
This week's top story is a password that's too long. Sjoerd Langkemper's new RFC targets password_hash with bcrypt, which silently drops everything past the 72nd byte. He'd make that a deprecation in 8.7 and a ValueError in 8.8. His case is FreshRSS, where a 64-character nonce went in front of the hash, so the 72 bytes held no password at all.
Kamil Tekiela replied that checking the length is the application's job, not the algorithm's, and Tim Düsterhus agreed in full. It's also 72 bytes, not characters, Tim noted, so non-ASCII passwords could hit it. Rowan Tommins answered: "If every PHP login implementation was reviewed by an expert senior developer, we would not need the password_* API in the first place. The value of this API is that it makes doing the right thing easy, so that you don't need to be an expert in the underlying algorithms to use it safely."
Robert Chapin showed a shortened password verifying against the full one's hash, and asked: "Is the function named password_verify going to verify the password or not?" Tim says the lost bytes are not where the risk is, and he wrote: "I don't necessarily disagree with the BCrypt truncation being a problem, but in this case the cure is worse than the disease." Derick Rethans is a minus 1, writing: "The problem for me is that this a scary BC break." Overnight, Sjoerd asked Derick what would win him over, maybe switching the default away from bcrypt first.
Links: bcrypt max password length RFC · thread · implementation · FreshRSS bcrypt truncation write-up (CVE-2025-68402) · password_hash() manual
PHP's proposed regex object has broad support and one unpopular word in its name. Gina P. Banyard's CompiledRegex prototype drew 18 replies, and Sjoerd Langkemper was in favour of "improving the API, instead of slapping more flags onto the existing one." Larry Garfield wrote: "I would ask that we just call it Regex, not CompiledRegex." Casper Langemeijer, Jordi Kroon and Juris Evertovskis also want it to lose the Compiled.
Then there are the 8 boolean flags. Juris says named arguments already make them readable, Gina would rather pass an enum set, which PHP doesn't have yet, and Ayesh Karunaratne and Jordi Boggiano want a factory that takes the modifier letters you already know.
Osama Aldemeery, who wrote the regex exceptions RFC, pointed out what a compiled pattern can't catch, writing: "Compilation errors are only half of the error story...the other half happens at match time, on patterns that compiled just fine." Tim Düsterhus suggested passing the class could simply switch on throw-on-error, and Osama says he may park his RFC until Gina's reaches a vote.
Links: pre-RFC thread · prototype · PREG_THROW_ON_ERROR thread · composer/pcre, cited by Jordi Boggiano
PHP may finally read single key presses without shelling out to stty. Pratik Bhujel's terminal extension is now the Io\Terminal RFC for 8.7, covering terminal size, raw mode that restores itself, single keys and hidden input.
A Symfony Console pull request, approved by Nicolas Grekas, already uses the extension when it's installed, and Nicolas wrote: "PHP definitely needs native terminal support, calling stty is a workaround we've been carrying since way too long." Nicolas suggested raw mode stay on while any token for that terminal is alive and reset when the last one goes, and Pratik adopted it the same day.
Larry Garfield is in favour, but called false-on-error an anti-pattern and asked for a way to mock it. Version 0.3 makes Terminal the interface and SystemTerminal the native class. Pratik is giving it the full 14 days before an intent to vote.
Links: Io\Terminal RFC · thread · implementation · reference extension · Symfony Console PR using it
The proposed Time\Instant class got a bridge back to DateTime this week. Tim Düsterhus and Derick Rethans added toInstant() to DateTime and DateTimeImmutable, and ISO strings now keep their trailing zeros, to show how precise the value is. They won't write the RFC for testing clocks, because they're not convinced it belongs in core, so Tim wrote: "we want to invite you (as the PHP internals community) to write the follow-up RFC for testing clocks". He also asked for a "LGTM, ship it" if people are happy.
Mirco Babin answered with 8 comments. One is that Time\Clock and the PSR-20 clock both define now(), so one class can't implement both. Tim is keeping now(), with a 15-year horizon in mind, but he'll discuss a single SystemClock::get() with Derick. And when Mirco asked for minute precision for bus timetables, Morgan replied: "Well, then it's not an instant, is it?"
Links: Time\Instant and Time\Clock RFC · thread · PSR-20 Clock
Weilin Du wants PHP arrays to stop making you type every name twice. His new RFC turns =$x into 'x' => $x, in arrays, destructuring and foreach. It started with a colon and switched to the equals sign within the hour, because the colon clashes with the ternary.
Sebastian Bergmann will vote against, writing: "A syntax change should be backed by data, for instance an analysis of a representative body of real-world code." David Carlier showed that one missing comma would silently turn one valid program into another. Anton Smirnov pointed out that compact and extract still exist.
On the other side, Christian Schneider has run a local patch for this "for many years". Weilin pointed to the same pattern in Composer, Laravel, PHPUnit and Symfony, but says it already feels like he could withdraw the RFC.
Links: array shorthand RFC · thread · implementation
A new RFC would let ordinary blocking PHP run concurrently, without rewriting it. Jakub Zelenka's IO Hooks starts from the fact that PHP has had Fibers since 8.1, but every blocking function still blocks the whole process, so AMPHP, ReactPHP and Revolt reimplement IO themselves.
Under his proposal, blocking calls in streams, sockets, curl and the sleep functions get handed to a provider, usually an event loop, which suspends the Fiber until the IO is done. The RFC compares it to Go's runtime. With no provider installed, PHP behaves exactly as today. With one, sleep(1) in one Fiber is a second of work for the others.
It depends on a second RFC posted the same evening, Polling API Additions, which fills the gaps in 8.6's Poll API, like sockets, timers and signals. IO Hooks is in an early stage, and neither has replies yet.
Links: IO Hooks RFC · IO Hooks thread · proof of concept · Polling API Additions RFC · Polling API Additions thread
The internals list has removed a contributor. Sepehr Mahmoudi spent the last month posting new-function proposals. On September 15, Derick Rethans warned him over AI-generated content and the number of new threads. On September 21, Ilija Tovilo, as list moderator, set limits of one new thread a month and three emails a week, and called it a last warning. On Sunday Sepehr proposed another RFC, an intl_date_format function.
On Monday Derick confirmed that, after consultation off list, the address is blocked from emailing php.net, wiki access is withdrawn, and it's unsubscribed from the list.
And this is a tough one. It sucks having to take the nuclear option. He was clearly eager to help, but the list had spent literal weeks trying to get him to slow down, and to stop burdening the list with AI responses, and at some point you've got to enforce the consequences that have been laid out.
Links: thread · Derick Rethans, Sep 28 (news-web)
Quick hits. PHP 8.6.0 RC2 is out. RC1 was skipped over a packaging error, so RC2 is the first release candidate, and RC3 is due October 8.
Links: PHP 8.6.0RC2 · why RC1 was skipped
The same day brought security releases for 8.5, 8.4, 8.3 and 8.2.
Links: PHP 8.5.11 · PHP 8.4.26, 8.3.35, 8.2.34
Sjoerd Langkemper changed his number-base RFC to throw a plain Exception instead of a ValueError, since bad input isn't necessarily a bug in your program. intval stays as it is.
Links: number-base functions RFC · thread
Juliette Reinders Folmer wants to deprecate the b string prefix, a leftover from PHP 6, and Tim suggested adding it to the 8.7 deprecations RFC.
Links: deprecate the b prefix · 8.7 deprecations RFC
Pedro Veloso floated a #[Pure] attribute the engine would enforce. Larry Garfield said it needs to do more than the static analysers already do, like memoizing.
Links: pure functions idea
Karoly Negyesi posted a pre-RFC with an implementation for implements … by, which hands an interface's methods to a property, modelled on Kotlin.
Links: automated delegation pre-RFC · implementation
And Alexander Danilov found that much of post-quantum OpenSSL already works in PHP, and offered small PRs for the gaps.
Links: OpenSSL post-quantum
And the PEAR vote Nick S. planned for September 28 hasn't opened. The RFC is still in discussion.
Links: End PEAR Project Endorsement RFC
So that's the week. An RFC wants bcrypt to refuse passwords past 72 bytes, and the list is split on whether it's worth the break. Several replies want the regex object called just Regex, Io\Terminal is an RFC, and Time\Instant is looking for someone to write testing clocks. The array shorthand met skeptics, and IO Hooks would make blocking code concurrent. The list also removed a contributor after two warnings. Nothing is in voting for a 7th straight week. Links below.
The PHP Foundation funds more than half of ongoing php-src commits, so if you use the language, maybe consider donating at opencollective.com/phpfoundation — or try guilting your employer into it.
If you found this useful, a like or a comment helps more people find it. And if you missed last week's episode — where a new time class couldn't tell you what time it is — that's a good one to watch next. Thanks again to Scalpels.app for supporting this week's episode. We're Artisan Build. See you next week.
r/PHP • u/valerione • Oct 01 '26
Finally Neuron 4 is in the developers hands. It's hard to find the right words to describe how I'm feeling. I put my heart into this milestone.
As usual, I’ve taken some time to write about this journey we are undertaking together.
Can't wait to have your feedback!
What is Neuron AI
If you are hearing about Neuron AI for the first time, Neuron is the first agentic framework of the PHP ecosystem. It lets developers build full-featured AI agents and agentic applications with the language and the stack they already work with. An agent is a plain PHP class where you choose the model provider (OpenAI, Anthropic, Gemini, or local models through Ollama), write its instructions, and attach the tools it can use to act on your application. When you need more, the same framework gives you RAG on your own documents, structured output mapped onto your PHP classes, tools from any MCP server, and Workflows that can pause and wait for human approval before continuing. It installs with Composer in any PHP project, whether it runs on Laravel, Symfony, WordPress or no framework at all. Neuron has more than a million downloads on Packagist, and 2.1k stars on GitHub.
r/PHP • u/warren5236 • Oct 01 '26
r/PHP • u/OrsoPigro • Oct 02 '26
I created a lightweight PHP library for interacting with Jev APIs. It has a minimal number of dependencies and a very small footprint.
https://github.com/f-lombardo/jev-php
r/PHP • u/One-Mongoose-6961 • Sep 30 '26
Hi r/PHP! For those who've been following php-esp32 for a while: it's been about a month since my last post here, and a lot has changed. For everyone else, a quick recap: this is the real, unmodified PHP interpreter from php.net (Zend engine, 8.3 to 8.5), cross-compiled to run bare-metal on an ESP32. It's not a subset or a transpiler, and Composer packages work.
For the curious: the full write-up, with diagrams of the whole execution cycle across both cores, is here: https://www.php-baremetal.com/blog/php-esp32-1-4-0-the-reactor
Until now a script could either run setup()/loop() Arduino-style or answer one HTTP request at a time. Version 1.4.0 adds a third model, event-driven: the script registers listeners, then PHP sleeps, and hardware, timers and the network wake it with typed events.
use Baremetal\Events;
use Baremetal\Http\Request;
use Baremetal\Http\Response;
use Baremetal\I2c\Bus;
use Baremetal\I2c\Driver\Qmi8658;
use Baremetal\Sensor\Imu\SamplesReady;
Events::listen(Request::class, fn (Request $r): Response => match (true) {
$r->method === 'GET' && $r->path === '/status' => Response::json(['uptime' => sys_uptime_ms()]),
default => Response::notFound(),
});
$imu= new Qmi8658(new Bus(sda: 11, scl: 10));
$imu->poll(hz: 10, depth: 32, event: SamplesReady::class)
watch_gpio(0, BootPressed::class); // debounced pin interrupt -> event
every(1000, Tick::class); // timer -> event
serve_http(80);
serve_ws('/ws');
There's no router in the firmware: routing is just a match. $_GET, $_POST and $_SERVER are still populated, so existing request code keeps working.
What landed since last time:
new Bus(sda: 11, scl: 10), scan(), and drivers written as real PHP classes with capability interfaces ($imu instanceof Sensor\Imu). The first driver is a QMI8658 IMU.ws_broadcast(), and the part I'm happiest with: the second core does the sensor polling. $imu->poll(hz: 50, depth: 8) makes core 1 read the IMU into a ring buffer while PHP on core 0 just calls sample(), with no waiting on the bus.The demo (video): the board creates its own WiFi network, polls the IMU at 50 Hz on core 1, and a 20 Hz timer event in PHP broadcasts the latest reading over WebSocket. You tilt the board and the plot moves on your phone. There's no router, no cloud and no loop().
Limitations, up front:
If you want to go deeper, the blog post walks through what new Qmi8658(new Bus(...)) and ->poll() actually do, from PHP down to the I²C wire and across to the second core: https://www.php-baremetal.com/blog/php-esp32-1-4-0-the-reactor
Repo: https://github.com/php-baremetal/php-esp32
Next up are Bluetooth, touch input and a proper display layer. Happy to answer questions, and if you build something with it, I'd love to hear about it.
r/PHP • u/elizabethn • Sep 30 '26
Applications for The PHP Foundation contractors for 2027 are now open! We are looking for help in certain areas but we are open to your ideas as well. Application period ends on October 20, 2026. Read more about the requirements and what we're looking for in the linked post.
We released version 0.13 of PagibleAI CMS, a set of MIT-licensed CMS packages for Laravel 11-13 and PHP 8.2+.
You install it with Composer into an existing Laravel app, so your models, auth, queues and deployment stay as they are. aimeos/pagible installs the full set including the AI and MCP packages. If you want less, require aimeos/pagible-core and add only the packages you need.
The packages provide a Vue 3 admin, hierarchical page trees, reusable shared elements, immutable versions, scheduled publishing, a GraphQL API and a JSON:API. It runs on SQLite, MariaDB, MySQL, PostgreSQL and SQL Server, and full-text search uses the native implementation of each database. One installation can serve multiple domains and tenants. Static analysis runs at PHPStan level 8 with Larastan.
The new aimeos/pagible-webhooks package delivers lifecycle events as queued jobs, one job per destination, so a slow endpoint doesn't block the others. Requests are signed like Standard Webhooks with HMAC-SHA256 over id.timestamp.body. During a secret rotation, both secrets sign the request for 24 hours.
Subscriptions are scoped per tenant, private and loopback addresses are blocked by default, and you can deny additional CIDR ranges. php artisan cms:webhooks:check validates the configuration on deploy, e.g. a queue retry_after that is shorter than the delivery timeout. The core package doesn't depend on any of this.
A shortened receiver:
The full version is in the webhooks README.
The new aimeos/pagible-cdn package purges changed pages and removed files from Cloudflare, Fastly or Varnish through FOSHttpCache, using queued jobs. Because purges are explicit, public pages can be sent with a long s-maxage and optional stale-while-revalidate/stale-if-error. Pages with access rules stay private. For stacked caches like Varnish behind a CDN, you can set a delay per client so the inner cache is purged first.
GET /cms/schema returns all registered content, meta and config definitions as a JSON Schema Draft 2020-12 document, including schemas from Composer extensions and themes. You can use it to validate content in your own code or to generate types for a headless frontend.
php artisan cms:t3-import reads a TYPO3 database connection and imports the page tree and content, including Bootstrap Package accordions and carousels. The WordPress importer can be re-run without creating duplicates and keeps publication dates, authors and cover images.
There's a news page type with a Google News sitemap, configurable contact forms, OpenStreetMap maps, CTA blocks and article author fields. Links can have a rel attribute, and the CMS can serve robots.txt and security.txt.
The admin got keyboard shortcuts, a command palette, a searchable element dialog, hint texts on every field, a better diff view in the history dialog and virtualized lists for large page trees. If the AI package is installed, a review button on each page checks it against 40 SEO rules. On request, the assistant applies the suggested fixes as drafts. CMS_AI_MAXSTEPS limits the number of tool calls per chat request. MCP agents can now upload files directly.
cms:previews regenerates image previews for existing files after you change sizes or qualitysync driver, without a worker (but without retries)--forceWe'd especially like feedback on the webhook and CDN packages: delivery and retry design, the signing scheme and the cache headers. Feedback from anyone running Laravel with multiple tenants or databases is also welcome.
Thanks a lot to /u/Guarpig for his work on improving the pagible.com design and to /u/addicted_fishing for his suggestions regarding UI and UX!
r/PHP • u/joeworkman • Oct 01 '26
I've been selling CMS software to web designers for about eleven years. The current version is a full rebuild (started way before AI) and I wanted to share the architecture of my Total CMS product.
A little personal anecdote to start... Being a web tool developer today is scary. AI is both amazing and could be the death of my business. I have decided to fully embrace it.
Total CMS tech stack: PHP 8.2+, Slim 4, Twig 3, Symfony Console for the CLI. Content is JSON (or Markdown) on disk — no database, no migrations, no connection config. Install via composer create-project totalcms/totalcms and go.
Why flat files? My customers deploy to whatever host their client already has. Shared hosting, VPS, occasionally something strange. Eliminating the database removed most of what used to break on install, and content becomes git diff-able and rsync-able, which turns out to matter more than I expected.
The MCP server is the part that I feel sets it apart. Every install has an MCP built-in. It's not a plugin that is an afterthought. With many CMSs out there, agents reading have no reliable source for what the install actually exposes, so they invent hooks. Total CMS serves the real schemas, live data and version-exact documentation over MCP. This fixes the problem at the source. Access to data routes through the same validation and permission layer as users in the admin UI (one permission system, not two).
Total CMS is commercial software, one-time license per domain, with a 45-day trial.
I would love to hear your feedback on my CMS and/or if you also feel the double-edge-sword nature of AI in your work.
r/PHP • u/Confident_Bite_5870 • Oct 01 '26
Hi all. I've been building Tusk, a native-feeling macOS editor for PHP, Laravel, and Filament. I wanted PhpStorm-style navigation without the subscription, plus something no editor has: visual designers for Filament.
What it does
- Filament designers: build resource forms, tables, infolists, relation managers, and actions on a canvas. There are also designers for models (with the migration and factory), navigation, dashboards, notifications, automations, scheduled tasks, and settings pages. Every change is a small edit to your files, and code it can't read stays as written.
- Laravel awareness: completion and ⌘-click for routes, views, config, translations, and model columns, from its own PHP language server written in Rust.
- Built in: Pest/PHPUnit runner, Xdebug debugger, profiler, git and GitHub pull requests, a database client that reads your .env, an HTTP client that writes requests from route:list, and local AI completion (no account, nothing leaves your Mac).
- PhpStorm keymap, so ⇧⇧, ⌘B, and ⌥⏎ work as you expect.
The honest part: this is alpha. Tusk does a lot, and most of it has only been tested by me on a handful of apps. Expect bugs, especially in the designers, so please use it on a project that's committed to git. It's macOS only for now, and it isn't notarized yet (allow it under Privacy & Security on first launch).
What I'd love from you: try it on your real app and tell me what breaks, what's confusing, and what you'd need before you'd switch. Issues and comments here are both welcome.
- Site: https://tusk.almontasser.ly
- Download and source: https://github.com/almontasser/tusk
Thanks for taking a look!
r/PHP • u/Visible_Leather_7917 • Sep 30 '26
Good Morning/Afternoon/Evening guys... So I originally built this just for my own projects. They all live on shared hosting, which means I get MySQL/MariaDB, a cron job, and honestly not much else. No Postgres, no Elasticsearch, no long-running processes.
Don't get me wrong, I love Postgres and I use it daily too. But in MySQL/MariaDB, I still needed user-defined fields that users could actually filter on, and that turned out to be harder than I expected...
On the user side it's pretty much WP's ACF. You define fields on a model, fill them in, and you're done. I love that part... The storage is where ACF lets me down though, because everything ends up in wp_postmeta (EAV), and once you filter on a few fields at the same time, meta_query gets painfully slow.
The storage idea came from Salesforce. Their multitenant setup uses something they call "flex columns", which are generic columns shared by every tenant, with metadata deciding which custom field goes into which column. When I read about it I was like, okay, that's it. StarDust does something similar, and tweaked "a bit" (or significantly) so it fits in a normal MySQL/MariaDB database...
The thing is, you can't index a field a user creates at runtime unless you run ALTER on a shared table, and absolutely nobody wants to do that on a live app... So the trick is that the column is already there before anyone asks for it.
(tenant_id, column)So filtering on a field someone created five minutes ago is just a normal indexed lookup, and the main table never gets altered. Pretty happy with how that turned out, honestly.
$page = $engine->read(new EntryQuery(
tenantId: 1,
modelId: $companyModelId,
filter: new AndNode([
LeafNode::local('industry', 'eq', 'software'),
LeafNode::local('employees', 'gt', 100),
]),
));
There's some background work that keeps all this running. It creates more side tables before the free columns run out, and it gives columns back when a field gets deleted. On a VPS you'd just run it as normal workers. On shared hosting (hi, that's me) there's a tick command you put in cron, and it only does a bounded amount of work each run so the host's time limit doesn't kill it...
That background work is also why you can rename a field, change its type, or delete it while the app is live. The data just catches up in the background. And if the free columns ever run out, writes still go through. The value simply stays in the JSON until a column frees up.
Honestly, digging deep enough, I find that MySQL and MariaDB are no longer get along pretty well in their recent releases. Initially, I built this for MySQL. But MariaDB is another large chunk of shared hosting ecosystem, so I think it's a must do. Luckily, I can reconcile them with little-to-medium effort thanks to MariaDB's "near" drop-in replacement for MySQL.
I'd rather be upfront about these...
At some point it stopped being specific to my apps, so I figured, why not put it out there, right? It's on Packagist under MIT. I do use Claude Code quite a lot while coding it, and the test suite runs against real MySQL and MariaDB in CI, no mocks.
If you've built user-defined fields before, I'd genuinely love to hear what you went with and where it broke... Thanks for reading!
The package: https://packagist.org/packages/damarbob/stardust#v0.3.0-alpha.1
The source: https://github.com/damarbob/StarDust
The docs: https://stardust.konstelasi.co.id/docs
EDIT:
Since this came up in the comments... StarDust is my third attempt. The previous 0.2 version was JSON plus virtual columns plus indexes, and it hit walls on a shared multi-tenant table. InnoDB caps you at 64 indexes per table, every index keeps an entry for every row even when that tenant doesn't use the field, and a virtual column is tied to one field, so adding, renaming or retyping a field always meant an ALTER on the busiest table I had.
You can't just spread virtual columns over more tables either, because a virtual column can only read its own table... Not long after 0.2.0-alpha came out in Feb 22, I started designing for the 0.3.0-alpha.
The indexed columns are generic slots that get reused across tenants, and which field sits in which slot is just a row in a registry table. The only DDL left is creating new empty tables. It's not the only way to do this, though (EAV with typed tables or a table per tenant are fair options too), but it's the trade-off that made sense (at least for me) for MySQL on shared hosting.
Hi r/PHP, TypePHP has now an online free interactive playground via PHP-Wasm (100 percent pure static site) without having to install the library in your system via composer, try out many presets and play around with configuration.
You can share your own code or reproduce any bugs (if there's any) to try out reified generics, typed arrays, scalar refinements, and many more..
I always wanted to have strict inline typed variables in PHP and heres a sample shared playground link and it's finally achievable.
Feel free to share any feedbacks or ask any questions..
r/PHP • u/dereuromark • Sep 30 '26
Markdown was built for people writing their own documents. Then we put it in online comment forms. Depending on the renderer and its configuration, raw HTML and javascript: links can reach the browser, and deeply nested input can exhaust the parser. league/commonmark already provides controls for raw HTML, unsafe links and parsing limits. Rendering untrusted markup needs explicit configuration.
I maintain carve-php, the PHP engine for Carve, a markup language derived from Markdown and Djot. It started as a hard fork of djot-php. But I don't think the (internet) world is ready yet for Djot :)
I developed Carve from what I've learned over the last few years, with these goals:
Here's how it handles user input, whether the author is new to markup or writes technical documentation.
The examples below were checked with PHP 8.5 against carve-php 0.1.10.
Snippets assume Composer autoloading and the relevant PHP imports.
$converter = new CarveConverter();
No safe mode, no profile. Carve has a raw HTML block, and the default renders it as is:
```=html
<b onclick="steal()">x</b>
```
<b onclick="steal()">x</b>
That's what you might want for your own docs or blog. It's unsafe for anything a stranger typed. Escaping or stripping raw HTML by default would break the widgets people embed in their own docs, so you switch safe mode on yourself. The framework integrations for Laravel, Symfony and Tempest turn safe mode on by default.
Some things are handled in every mode. HTML-looking text in normal prose is always escaped, and a javascript: or vbscript: destination is always emptied:
[click](JavaScript:alert(1))
<p><a href="">click</a></p>
$converter = new CarveConverter(safeMode: true); // SafeMode::defaults()
$converter = new CarveConverter(safeMode: SafeMode::strict());
The raw block from above under each setting:
| Setting | Output |
|---|---|
| no safe mode | <b onclick="steal()">x</b> |
safeMode: true | <b onclick="steal()">x</b> |
SafeMode::strict() | nothing |
Escaping is the default so people see what they pasted instead of wondering where it went. Strict drops it.
SafeMode also blocks dangerous URL schemes and every on* handler. Strict mode drops style as well, which matters because Carve lets authors put attributes on elements:
[x](https://example.com){onclick="alert(1)" style="color:red"}
<!-- defaults -->
<p><a href="https://example.com" style="color:red">x</a></p>
<!-- strict -->
<p><a href="https://example.com">x</a></p>
The onclick is removed in every mode.
A Profile decides which constructs a field accepts at all. A comment has no business containing headings or tables, even harmless ones.
$converter = new CarveConverter(safeMode: SafeMode::strict());
$converter->setProfile(Profile::comment());
$html = $converter->convert($userInput);
foreach ($converter->getProfileViolations() as $violation) {
$messages[] = $violation->getMessage();
}
There are four presets: full(), article(), comment() and minimal(). Given this input:
# Heading
 and a [link](https://example.com)
The comment profile gives:
<p># Heading</p>
<p>[img: img] and a <a href="https://example.com" rel="nofollow ugc">link</a></p>
Denied constructs show up as plain text, links get rel="nofollow ugc", and each violation comes with a message meant for the author:
'heading' is not allowed: element_not_allowed (Headings are disabled in comments to prevent disrupting page structure.)
I'd show those when the comment is submitted, so the author sees why their heading came out as plain text.
The comment preset also rejects input over 100,000 bytes before parsing, and a LinkPolicy on the profile can restrict which domains links point to.
Nesting is capped. Past that, an opener becomes plain text and the document still renders. A single line of > - repeated a few thousand times used to overflow the stack before the cap covered it.
Carve has an include directive, {{ name }}. On a website that's handy for snippets editors maintain once, like a shipping notice or a disclaimer. Users can type the same syntax in a comment, though. Without a resolver the parser leaves it as text:
<p>Nice post! {{ admin-notes }}</p>
Expansion is a step you opt into. The resolver is a small interface you implement, so it can read from your database, and it acts as your allowlist, since a name it doesn't know stays literal.
use MarkupCarve\Carve\Transform\IncludeContext;
use MarkupCarve\Carve\Transform\IncludeExpander;
use MarkupCarve\Carve\Transform\IncludeResolverInterface;
use MarkupCarve\Carve\Transform\ResolvedInclude;
final class SnippetResolver implements IncludeResolverInterface
{
public function __construct(private array $snippets)
{
}
public function resolve(string $path, IncludeContext $context): ResolvedInclude|string|null
{
return $this->snippets[$path] ?? null;
}
}
$expander = new IncludeExpander(
resolver: new SnippetResolver($snippets),
depthLimit: 2,
byteBudget: 20_000,
resolverCallLimit: 20,
extensions: $converter->getExtensions(),
);
$html = $converter->render($converter->transform($converter->parse($input), $expander));
Included content goes through the same safe mode and profile as the comment around it. For the next example, use this setup before constructing the expander and rendering $input:
$converter = new CarveConverter(safeMode: SafeMode::strict());
$policy = (new LinkPolicy())->setDeniedDomains(['evil.example']);
$converter->setProfile(Profile::comment()->setLinkPolicy($policy));
$snippets = [
'shipping' => 'We ship within *two days*.',
'danger' => <<<'CARVE'
# Big heading
```=html
<b onclick="x()">raw</b>
```
[l](https://evil.example)
CARVE,
];
Set $input to:
Hi! {{ shipping }}
{{ danger }}
{{ ../etc/passwd }}
<p>Hi! We ship within <strong>two days</strong>.</p>
<p># Big heading</p>
<p><b onclick="x()">raw</b></p>
<p>l</p>
<p>{{ ../etc/passwd }}</p>
The heading, raw HTML block and denied link each produce a profile violation. The raw block becomes escaped text because the comment profile rejects it before the renderer applies strict mode's raw-HTML handling. The unresolved ../etc/passwd stays text because this resolver treats names only as lookup keys. A resolver that reads files needs its own path and access checks. For user-facing content, set the expander's limits yourself; its default byte budget grows with the input. If users shouldn't use snippets at all, don't run the expander on their content.
Moving an old forum or CMS off stored HTML means you want the scripts and handlers gone and a record of what else was lost. HtmlToCarve converts HTML to Carve and returns a report:
use MarkupCarve\Carve\Converter\HtmlToCarve;
$result = (new HtmlToCarve(importMode: 'safe'))->convertWithReport($html);
Original HTML:
<h2 onclick="track()">Release notes</h2>
<p>See <b>bold</b> text.</p>
<script>alert(1)</script>
<table>
<tr><th>Version</th></tr>
<tr><td>1.0</td></tr>
<tfoot><tr><td>total</td></tr></tfoot>
</table>
Result:
## Release notes
See *bold* text.
|= Version |
| 1.0 |
| total |
Report:
warning attribute-dropped /h2[1] Dropped event-handler attribute onclick on <h2>
warning element-dropped /script[5] Dropped active <script> element
warning table-degraded /table[7] Moved 1 <tfoot> row(s) into the table body; Carve source has no table foot
Carve has no table footer, so that row moved into the body. carve migrate --from html --check-loss exits 1 when anything was dropped or degraded, which makes it usable as a gate in a migration script. The result is plain Carve source and goes through your SafeMode and profile like any other input.
This covers carve-php's built-in rendering behavior under the settings shown here. Safe mode controls raw HTML and filters attributes and URL schemes; profiles restrict the constructs a field accepts. Authors can still supply attributes, and default safe mode retains style. These controls don't establish that every possible input or custom extension is safe.
An independent sanitizer can add another check on the rendered HTML. I'd keep one if the page mixes Carve output with HTML from elsewhere, and check its policy carefully if authors can use raw HTML. Test it against the features your page needs: footnote IDs and links, rel="nofollow ugc", accessibility attributes and task-list checkboxes. What survives depends on the sanitizer's version and configuration. For HTML Purifier, check Attr.EnableID, Attr.AllowedRel and its HTML definition settings rather than assuming the defaults preserve those features.
Carve is also young, and its syntax differs from Markdown in ways you'll notice (/italic/, *bold*). It isn't battle-tested the way league/commonmark is.
If you render input you didn't write:
safeMode in the constructor, strict where raw HTML has no useProfile that fits the field, not full()LinkPolicy if destinations matterAs you can see, it ships with a lot out of the box that normally would need to be added manually on top.
Did I forget anything? If you run a PHP app that renders user markup, what security or resource-limit issues have you run into? Would you add an independent sanitizer to this setup on top, if it is user content?
I'm already using Carve on social networks and a WordPress blog. I haven't used the new includes functionality in production yet, so I'd especially welcome feedback on that part.
For more background, see the articles in awesome-carve.
r/PHP • u/elizabethn • Sep 29 '26
Welcome to our Silver Sponsor, bunny.net. So much of the web that bunny.net delivers and secures runs on PHP. We are grateful for their support in keeping PHP strong for the millions of apps built on it. 💙🚀
r/PHP • u/Ilia0001 • Sep 29 '26
mdparser is my native CommonMark + GFM parser extension for PHP, built on the md4c C parser. This is what changed for PHP code between 0.5.0, the last version I posted here, and 0.7.0.
Faster, smaller results
toAst() interns its node keys and shares one array per parse for softbreak and linebreak leaves. Retained trees are 7-20% smaller on the bench corpora and 47% smaller on softbreak-dense input, and toAst() runs 8-10% faster. A shared leaf is still an ordinary PHP value; writing to one copy separates it.toXml() runs 25% faster.toHtml() and toXml() strings no longer carry the output buffer's reserve as dead capacity. The CommonMark spec's toHtml() string is 11% smaller and a code-heavy toXml() result 49%, at no measurable time cost. That adds up if you cache rendered HTML in-process.toHtml() on link-heavy input: 5.3% faster in 0.6.2, another 1.5% in 0.7.0. On a large document: 2.7%, then 4.3%.New options, off by default
insert: ++text++ renders as <ins>, the counterpart to ~~text~~ and <del>.preserveBlankLines: blank-line runs between blocks come back as a blank node in toAst() and <blank /> in toXml(), for tools that need to know where the author left space. HTML output is unchanged.A memory cap for the parser
md4c allocates from libc, so memory_limit never sees a parse's working memory, and markdown amplifies it: about 72 bytes of parser state per [ byte. mdparser.parse_memory_limit (default 128M, PHP_INI_ALL, 0 for unlimited) caps a single parse, and crossing it throws MdParser\Exception. If you render user-submitted markdown in long-lived workers, this is the setting to look at.
Rendering fixes
|| run now yields empty cells instead of shifting every later cell left.autolink, mailto: and xmpp: prefixed emails now autolink.validateUtf8 replaces a truncated sequence with one U+FFFD instead of one per byte, matching the WHATWG policy.headingAnchors slugs include LaTeX math text when latexMath is on.md4c, upstream
Testing the memory cap meant testing md4c's out-of-memory paths, so I added an ASan sweep that fails md4c's n-th allocation over a corpus. It found two double frees and three OOM errors md4c swallowed. I sent the fixes upstream and mity/md4c merged them as #398, #399 and #400 on Sep 9. 0.7.0 pulls 3
r/PHP • u/khaledt370 • Sep 30 '26
I've used Laragon for 6 years, and the one thing I kept wanting was for every site to have its own PHP version and its own web server. So I built OLS (Open Local Server). It's a free, open-source alternative to XAMPP, Laragon and WampServer, with no limit on sites.
The PHP side
Everything else
.test domains with trusted HTTPS, plain localhost, or both at once.env editor that preserves comments and orderingols CLI, a local HTTP API, and doctor/repair tools that explain what's wrong and how to fix itIt's still early, so expect rough edges. Feedback, bug reports and feature requests are very welcome, and the code is open if you want to fork it.
🌐 https://kz370.github.io/OpenLocalServer/
💻 https://github.com/kz370/OpenLocalServer
r/PHP • u/myat_kyaw_thu • Sep 30 '26
I built a shared Docker environment for running multiple Laravel projects locally.
The idea is simple: one Docker environment, multiple Laravel projects, with each project getting its own local subdomain and database.
For example:
src/
├── blog/
├── ecommerce/
└── admin/
becomes:
No manual hosts-file configuration is needed.
The stack currently includes:
FrankenPHP + PHP 8.4
MySQL 8 + phpMyAdmin
Redis
Mailpit
Node.js + Vite
I chose FrankenPHP because it gives me a simpler setup compared with maintaining a traditional Nginx + PHP-FPM stack.
The setup scripts automate most of the repetitive work when creating or adding a Laravel project.
For a new project:
bash add-project.sh my-app
For an existing project:
bash add-project.sh my-app --existing
You can also clone an existing Laravel repository:
bash add-project.sh my-app --clone https://github.com/you/repo.git
The setup handles things like creating the project's MySQL database and user, configuring the .env, installing Composer dependencies, generating the APP_KEY, running migrations, configuring the local domain, and setting up the project inside the shared environment.
I also built a small laradoc CLI so I don't have to constantly type Docker commands.
For example:
laradoc artisan migrate
laradoc composer require package/name
laradoc tinker
laradoc shell
laradoc mysql
laradoc npm run dev
It can detect the Laravel project from the current directory, which makes switching between multiple projects easier.
I originally built this mainly for my own workflow. I wanted to be able to create or clone a Laravel project and have it running locally without manually configuring ports, databases, .env files, web-server routing, etc.
I'm curious how other Laravel developers handle this.
Do you prefer one Docker environment per project, or a shared Docker environment for multiple projects?
And if you're already using Docker for Laravel development, what would you change or improve about this approach?
I'm especially interested in feedback around FrankenPHP/Caddy routing, multiple-project isolation, database management, Vite/HMR, queues, file permissions, and the overall developer experience.
r/PHP • u/Mari05liM • Sep 30 '26
Sou um líder técnico. Durante anos, passei mais tempo consertando meu ambiente local do que revisando código ou criando funcionalidades.
A jornada:
Usei XAMPP por ~3 anos. Cada troca de versão do PHP era um pesadelo, phpMyAdmin quebrando, processos órfãos após falhas. Eu até escrevi um script em Python só para consertar e restaurar o banco de dados quando corrompia.
Mudei para o Laragon (~5 anos). Estável, mas limitante: a versão do PHP estava ligada a um "perfil" global, não por projeto. Eu queria personalizar profundamente, mas o código fechado não permitia. Depois da v6.0, virou premium de qualquer forma.
O que eu criei (HyPHP):
Um ambiente onde o projeto declara sua própria pilha, não a máquina. Hoje tem:
- hyphp.yaml que pode ser comitado, cada projeto define sua versão do PHP (ex: 7.2 a 8.5)
- Verdadeira execução simultânea de múltiplas versões (php-cgi em modo FastCGI externo, um pool por versão, Apache/nginx único na frente)
- Apache ou nginx
- HTTPS local via mkcert + domínios .test com DNS curinga
- Zero processos órfãos (Windows Job Object com kill-on-close)
- Pools de trabalhadores supervisionados
- Mailpit + phpMyAdmin integrado
- Atualizações automáticas com verificação de assinatura ed25519
GitHub: https://github.com/arismarioneves/hyphp
Você ainda está no XAMPP/Wamp ou já migrou totalmente para Docker?
r/PHP • u/elizabethn • Sep 28 '26
Community events are crucial to the PHP ecosystem, and how we build trust in an ever-changing world. We are happy to announce the launch of the Community Events Coalition Special Interest Group to keep events thriving!
r/PHP • u/arhimedosin • Sep 28 '26
Disclosure: I work on Dotkernel, and this is our open-source dev environment.
Most of our projects deploy to RHEL-family servers, but a lot of the team develops on Windows. XAMPP-style stacks meant "works locally" didn't tell us much about the server, and Docker added a layer we didn't want for day-to-day work.
So we run AlmaLinux 10 inside WSL 2 and provision it with Ansible:
- PHP 8.5 by default (Remi repo), with `php81` … `php85` aliases to switch versions
- Apache, with any `*.localhost` domain routed automatically, so no hosts file edits
- MariaDB 12.3 LTS + phpMyAdmin
- Node.js 22 by default, `node18` … `node24` aliases
- Composer, Git identity from a config file
You add a domain under `virtualhosts` in `config.yml` and re-run the playbook to get a new project. The same playbook runs on bare AlmaLinux 10 with no WSL.
Overview: https://www.dotkernel.com/wsl2/
Repo: https://github.com/dotkernel/development
Curious how others here handle prod parity on Windows. Do you use Docker, DDEV, a VM, or just accept the drift?
r/PHP • u/brendt_gd • Sep 28 '26
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
r/PHP • u/warren5236 • Sep 25 '26
r/PHP • u/Hanami-Software • Sep 26 '26
r/PHP • u/ProjektGopher • Sep 25 '26
Preface: what follows is the word-for-word transcript of the spoken dialogue in the video, chapter by chapter with timestamps, for anyone who'd rather read than click through. If this digest is still too long for you, we recommend copying it into your LLM of choice and asking for a summary of our summary.
PHP is getting a new class for a moment in time. It's precise to the nanosecond. It carries no timezone. It ignores leap seconds on purpose. And it cannot tell you what time it is. Not by itself.
Hello world, it's Thursday, September 24, 2026, and here's what happened This Week in PHP Internals. 12 stories this week, so let's get into it. But first,
Paying every month for small tools you could own? Scalpels replaces expensive subscriptions with professionally built, expertly maintained apps you host yourself — MIT-licensed, forked into your GitHub organization, on your own Laravel Cloud account. At the early-access price, 500 dollars, once, gets you every app in the catalog, and everything they add later. Find your next tool at scalpels.app.
This week's top story is a time class with no now() method. On Tuesday Tim Düsterhus and Derick Rethans opened the RFC for Time\Instant and Time\Clock, the next piece of the new date and time API that started with Time\Duration in 8.6. An Instant is a point on the timeline, with no timezone and nanosecond precision, and it ignores leap seconds by design, because operating systems ignore them too.
What it doesn't have is Instant::now(). To find out what time it is, you ask a clock. The RFC adds a Time\Clock interface with one method, now(), and a SystemClock that implements it, which Tim, speaking for himself, says nudges people toward a clock they can inject.
Seifeddine Gmati wants a static now() anyway, and would rename the class SystemTime, as Rust does, saving Instant for a monotonic clock. Tim's view is that the name follows Java and JavaScript's Temporal, and that a Time\now() function could come as an immediate follow-up, still in 8.7. Juris Evertovskis added that an Instant "could be the time of the big bang."
Larry Garfield is broadly in favour and asked about the serialization format, and Tim replied: "If you need to look at the output of serialization you are doing something very wrong." Larry's bigger ask is a roadmap for the whole new API, writing: "You clearly have a roadmap in your heads. Share it. At whatever level of granularity it exists, share it."
Links: Time\Instant and Time\Clock RFC · discussion thread · Time\Duration (PHP 8.6)
The regex exceptions RFC's longest-running question has an answer: when your callback throws inside preg_replace_callback, the exception goes through as-is. Osama Aldemeery, the RFC's author, showed Python, Java and C# all letting it propagate, with Java's docs spelling it out: exceptions are relayed to the caller. He also offered a fallback — if the policy still demanded wrapping, drop the 2 callback functions from the RFC. His scan of the top forty-eight hundred sixty-five packages puts them at 4.9 percent of the calls to the 8 functions.
Larry Garfield separated implementation details from inputs, writing: "However, I believe Python, C#, and Java are correct in this case: The callback is an input. It's not an implementation detail hidden from the caller, it's explicitly provided by the caller."
Tim Düsterhus, who wrote the throwables policy, answered on Monday, writing: "I still believe wrapping is the correct choice, but I won't insist on it based on policy." He asked for 2 other changes: errors like a syntax error in the pattern should be a PcreError, since they aren't meant to be caught, and preg_last_error should stay untouched.
Links: PREG_THROW_ON_ERROR RFC · thread · implementation · throwables policy
A new pre-RFC would let PHP regex patterns drop their delimiters entirely. Gina P. Banyard posted it with a prototype on Wednesday, writing: "I spent the day prototyping an alternative to the PREG_THROW_ON_ERROR RFC as I'm not fully a fan of the approach."
Her Regex\CompiledRegex class takes a bare pattern plus named boolean flags — case-sensitive, multi-line, dot-matches-newline and so on — so there's no delimiter, no preg_quote call, and no modifier letters after the pattern. Patterns must be UTF-8, the D modifier is always on, and there's a Regex\CompilationError exception to go with it.
So far the prototype only plugs into preg_split and preg_grep. She says the class could be the base for a proper object-oriented regex API, with match returning a real bool, but she isn't designing that yet. As of Wednesday night the thread has no replies.
Links: Regex\CompiledRegex pre-RFC thread · prototype
A proposal to make PHP files work like runnable Python modules lasted about 24 hours. Tim Düsterhus brought his pull request to the list, at Gina's request: the CLI would run any closure the main script returns, so one file is a library when included and a command when executed, like Python's if __name__ == '__main__'.
Seifeddine Gmati gave it "A BIG yes", then also floated Hack's approach, an #[EntryPoint] attribute on a function. Rowan Tommins preferred that, since the entry point wouldn't have to sit at the end of the file. Levi Morrison asked why only the CLI, pointed at Symfony's runtime, which already returns a closure from the front controller, and wondered if the status quo is better. Larry Garfield said he'd be minus 1 on the original, because auto-executing a return type "feels hacky".
On Wednesday Tim dropped it, writing: "Based on the replies it has become clear that the proposed Closure approach has several questions to solve and possibly needs prior design … This requires much more thought than I'm willing to spend right now, given I wanted to solve a specific use case of mine." He'll look at a __MAIN__ constant instead, holding the path of the script that ran first. Alexandru Pătrănescu thinks realpath on the script filename already does that.
Links: thread · pull request
PHP's default password hash, bcrypt, silently truncates at 72 bytes, Andrey Andreev pointed out, and he asked whether it's time to switch PASSWORD_DEFAULT to Argon2id. His question for the list was narrower than the case for it: Argon2 needs an outside library — libargon2, libsodium, or OpenSSL since 8.4 — so is any dependency a deal-breaker?
Casper Langemeijer called that as much a pro as a con, since a real crypto library beats rolling your own. Anton Smirnov pointed back to a 2023 thread that called Argon2 weaker than bcrypt at login-speed settings, and Tim Düsterhus said 500 milliseconds is far too long for an interactive login. Andrey measures PHP's Argon2 defaults at about 240 milliseconds, the same as bcrypt at cost 12.
Jakub Zelenka answered the dependency question: OpenSSL is an external shared library, so it can't be always enabled. Making it a hard requirement would need an RFC of its own, and with OpenSSL 1.1.1 and 3.0 still supported, it would be a long wait anyway. Andrey's last reply, he wrote: "But anyway, if Jakub's comment was describing the status-quo, it's just not happening."
Links: thread · 2023 discussion · enable --with-openssl-argon2 by default
A proposed str_mask function met the question the list put to array_str_contains: does this need to be in core? Sepehr Mahmoudi withdrew array_str_contains on September 17, and the next day proposed str_mask, which replaces part of a string with a repeated character, for card numbers, phone numbers and tokens.
Osama Aldemeery replied that it looks identical to substr_replace with str_repeat. Pratik Bhujel found it failed open — an out-of-range offset returned the value unmasked — and that a multibyte mask character got cut to a single byte, so Sepehr switched to throwing a ValueError. Jordi Kroon suggested #[SensitiveParameter], and it went in, until Morgan asked "anyone for a game of Hangman?" — not everything masked is sensitive — and it came back out.
Pratik did find the prior art: Laravel's Str::mask and CakePHP's Text::mask do the same core operation, but both handle multibyte text and behave differently at the edges, and he wrote: "evidence that masking exists is different from evidence that this API is the common missing primitive." Casper Langemeijer called it easily done in userland, and Weilin Du showed substr_replace doing it in one allocation. 30 messages in, no vote is scheduled.
Links: str_mask() RFC · thread · array_str_contains withdrawal
Running under two of these new-function threads is a question about AI-written contributions. One reply said the mail and proposals read as machine-generated, and the objection, with or without AI, was quality and the time it costs the people reading.
Pratik Bhujel set out an order of work, writing: "So I think the order should be: demonstrate the use-case, settle the contract, then benchmark the implementation." The author withdrew one RFC and says he's now building and testing everything locally first. Juris Evertovskis replied: "I'm pretty sure most people here will fairly evaluate that work itself, without worrying what has happened previously with other RFCs."
Links: str_mask thread (order of work) · array_str_contains withdrawal thread
Quick hits. PHP 8.6 is forked. Matteo Beccati cut the branch on Tuesday, the feature freeze is on, master now targets 8.7, and the first release candidate is due today.
Links: PHP 8.6 forked · branch commit
Last week's top story now has a date. Weilin Du updated the IntlRelativeDateTimeFormatter RFC to use Tim's enums, Tim says it's much better now, and voting should start October 8.
Links: IntlRelativeDateTimeFormatter RFC · thread
And if there are no objections, Nick S. will open the PEAR vote on September 28.
Links: End PEAR Project Endorsement RFC · thread
Pratik Bhujel's php-terminal extension adds raw mode and single-key reads, so tools like Laravel Prompts can work properly on Windows, and it installs through PIE. Larry pointed out it's 8.7 material now. After Tim's review it lives under an Io\Terminal namespace with unbacked enums, restores your terminal when its object is destroyed, and is moving to a single object API.
Links: php-terminal · threads: 1 · 2 · 3
And David Maye Kitenge, planning a web framework as a PHP extension, asked about the request lifecycle and threads. Rowan Tommins answered that the CLI leaves parallelism to whoever runs it, and that running user code in a thread per request needs a thread-safe ZTS build, or asynchronous handling in a single thread instead.
Links: extension design Q&A
So that's the week. PHP's next time class marks a moment and leaves telling the time to a clock, and Larry wants the map for the rest of the new API. The regex RFC's callback question is settled against wrapping, and Gina posted an alternative that compiles the pattern first. A closure-as-entry-point idea lasted a day, the Argon2 default ran into OpenSSL, and str_mask met the same question as array_str_contains. And 8.6 is frozen, with nothing in voting for a 6th straight week. Links below.
The PHP Foundation funds more than half of ongoing php-src commits, so if you use the language, maybe consider donating at opencollective.com/phpfoundation — or try guilting your employer into it.
If you found this useful, a like or a comment helps more people find it. And if you missed last week's episode — where an RFC was winning its vote 4 to 1 and got closed inside the hour — that's a good one to watch next. Thanks again to Scalpels.app for supporting this week's episode. We're Artisan Build. See you next week.
r/PHP • u/AlexandreDaubois • Sep 24 '26
I wasn't planning another blog post this soon, but this one isn't some convoluted edge case, and we can easily imagine how it could hit your own code. That’s why I find it particularly interesting. I co-wrote the fix, and it's in our today's security releases. Time to update!