Do We Really Need PHP’s Proposed `using` Keyword?
Every few years, a PHP RFC comes along that’s interesting enough to make me pause—and ask a simple question: Is this actually solving a problem we can’t already solve? The new Context Managers RFC introduces a using keyword intended to mimic Python’s with statement. It aims to make resource handling cleaner by automatically running setup and teardown code around a scoped block. Here’s the motivating example from the RFC. Today, you write something like: ...