<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Snigdho Upadhyay</title>
    <description>The latest articles on DEV Community by Snigdho Upadhyay (@snigdho5).</description>
    <link>https://dev.to/snigdho5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250270%2Fe818f8f4-2024-4b23-987a-c58db06d15c3.jpg</url>
      <title>DEV Community: Snigdho Upadhyay</title>
      <link>https://dev.to/snigdho5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/snigdho5"/>
    <language>en</language>
    <item>
      <title>NexPHP – Next-gen PHP framework with Less Code, More Power, and Zero Magic</title>
      <dc:creator>Snigdho Upadhyay</dc:creator>
      <pubDate>Tue, 17 Nov 2026 16:40:49 +0000</pubDate>
      <link>https://dev.to/snigdho5/nexphp-next-gen-php-framework-with-less-code-more-power-and-zero-magic-5eh2</link>
      <guid>https://dev.to/snigdho5/nexphp-next-gen-php-framework-with-less-code-more-power-and-zero-magic-5eh2</guid>
      <description>&lt;h1&gt;
  
  
  Why I Built NexPHP: Modern PHP with Less Code, More Power, and Zero Magic
&lt;/h1&gt;

&lt;p&gt;PHP in 2026 is unrecognizable from what it was a decade ago. With PHP 8.3+, strict types, enums, readonly properties, attributes, and Fibers, the language itself has become one of the fastest, most reliable backends on the web.&lt;/p&gt;

&lt;p&gt;Yet, many framework ecosystems still rely on architectural conventions invented in 2011:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Facades and global state.&lt;/li&gt;
&lt;li&gt;Dynamic magic methods that confuse static analysis and AI coding tools.&lt;/li&gt;
&lt;li&gt;Architecture solely centered on the classic FPM "shared-nothing" model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why I created &lt;strong&gt;NexPHP&lt;/strong&gt;: a modern framework designed from scratch around two realities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Modern runtimes&lt;/strong&gt; (FrankenPHP and long-lived persistent workers).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-assisted "vibe-coding"&lt;/strong&gt; (where explicit types and zero magic lead to effortless AI collaboration).&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The Core Principles
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Zero Magic, Strict Types
&lt;/h3&gt;

&lt;p&gt;No hidden metaprogramming. If a controller action expects a validated request, you simply typehint your &lt;code&gt;FormRequest&lt;/code&gt; subclass:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;#[Post('/products')]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CreateProductRequest&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ResponseInterface&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// $request is automatically resolved, validated, and injected.&lt;/span&gt;
    &lt;span class="c1"&gt;// If validation fails, a 422 JSON response is returned automatically.&lt;/span&gt;
    &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JsonResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'status'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'created'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because everything has explicit types and attributes, AI models (Cursor, Windsurf, Copilot) generate working code on the first attempt without guessing.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Dual-Runtime Readiness
&lt;/h3&gt;

&lt;p&gt;In persistent worker mode, PHP keeps the application in memory. If not designed carefully, user identity or database state can leak across requests.&lt;/p&gt;

&lt;p&gt;NexPHP features built-in &lt;strong&gt;request-scope isolation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Singletons live across the worker lifetime.&lt;/li&gt;
&lt;li&gt;Scoped bindings (current user, request, CSRF) are automatically wiped via &lt;code&gt;$app-&amp;gt;forgetScoped()&lt;/code&gt; after each response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In benchmarks, NexPHP achieves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;~218,000 req/sec&lt;/strong&gt; in persistent worker mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0.00 MB memory growth&lt;/strong&gt; over a 10,000-request soak test.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Native Fiber Concurrency
&lt;/h3&gt;

&lt;p&gt;No complex asynchronous event loops. You can run concurrent I/O operations cooperatively using PHP Fibers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Nex&lt;/span&gt;\&lt;span class="nc"&gt;Concurrency&lt;/span&gt;\&lt;span class="nc"&gt;Scheduler&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$scheduler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scheduler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$scheduler&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'user'&lt;/span&gt;  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$httpClient&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.example.com/user'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'order'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$httpClient&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.example.com/order'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Full-Stack Services Included
&lt;/h3&gt;

&lt;p&gt;NexPHP includes everything needed for production SaaS applications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Queues:&lt;/strong&gt; Database-backed queue with exponential retry backoff and failed-job dead-letter stores.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scheduler:&lt;/strong&gt; Cron-like DSL (&lt;code&gt;dailyAt('02:00')&lt;/code&gt;) with lock-based overlap prevention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; Sliding-window rate limiting, CSRF verification, and CORS preflight handling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability:&lt;/strong&gt; PSR-3 structured JSON logging with automatic secret redaction (&lt;code&gt;password&lt;/code&gt;, &lt;code&gt;token&lt;/code&gt;), and Prometheus metrics exporter.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It Out in 30 Seconds
&lt;/h2&gt;

&lt;p&gt;You can start a new project right now via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer create-project nexphp/nexphp my-api
&lt;span class="nb"&gt;cd&lt;/span&gt; my-api
php bin/nex serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/snigdho5/nexphp" rel="noopener noreferrer"&gt;https://github.com/snigdho5/nexphp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packagist:&lt;/strong&gt; &lt;a href="https://packagist.org/packages/nexphp/nexphp" rel="noopener noreferrer"&gt;https://packagist.org/packages/nexphp/nexphp&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d love to hear your thoughts, feedback, and pull requests!&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>opensource</category>
      <category>php</category>
    </item>
  </channel>
</rss>
