WebForms.php 2.1 has been released as the PHP back-end implementation of WebForms Core 2.1.
This release is different from a typical porting story.
The PHP implementation was converted from the C# implementation of WebForms Core using DeepSeek, and then independently evaluated with Qwen.
The process was not simply: C# → PHP It was: C# → DeepSeek conversion → manual review → Qwen evaluation → corrections → testing → release This article explains that process and some of the interesting problems that appeared during the conversion.
What is WebForms.php?
WebForms.php is the PHP back-end part of WebForms Core.
WebForms Core is a server-driven web technology based on the Commander–Executor concept.
The server generates commands that describe UI operations and execution flow.
WebFormsJS, running in the browser, interprets and executes those commands.
The WebForms class itself does not manipulate the browser DOM directly.
It generates the WebForms Core command structure.
This makes the WebForms class particularly suitable for implementation in multiple programming languages.
The PHP implementation provides the same WebForms Core programming model for PHP applications.
Why Convert the C# Implementation?
WebForms Core already has implementations for multiple programming languages.
The C# implementation is the primary reference implementation and contains a large number of methods for: DOM manipulation event management Fetch operations conditions loops state management storage browser history WebSockets SSE templates selectors Action Controls and other WebForms Core operations The WebForms class mainly generates command strings.
Because of this architecture, the fundamental logic does not need to be redesigned for every language.
The objective of the PHP implementation was therefore to preserve the behavior and output of the C# implementation while adapting the code to PHP conventions and language capabilities.
DeepSeek Conversion I provided the C# implementation and related helper classes to DeepSeek.
The instructions were intentionally strict.
DeepSeek was asked to first analyze the structure and explain the conversion approach.
The important requirement was that the conversion should preserve the behavior of the C# implementation.
However, the PHP implementation should not simply look like C# code written with PHP syntax.
The destination language's conventions were explicitly required.
For example, PHP naming conventions should be used where appropriate.
A C# method such as: should become: and parameters should follow PHP naming conventions: rather than preserving C#-style parameter names such as: The same principle applied to language features.
If C# used a feature that did not exist in PHP, the conversion needed to use an appropriate PHP equivalent rather than attempting to reproduce the syntax literally.
Overloading Was One of the Interesting Problems C# supports method overloading.
PHP does not support traditional method overloading based on parameter signatures in the same way.
Therefore, overloaded C# methods needed to be represented using PHP language features where possible.
For example, instead of creating unnecessary methods for different parameter types, PHP Union Types can be used.
A method can accept: and determine the appropriate behavior internally.
For example: This keeps the public API compact while preserving the behavior expected from the overloaded C# methods.
Nullable parameters were also handled using PHP's nullable types and default values.
For example: can represent an optional second argument when converting an overloaded method such as a random-number operation.
The important point is that the goal was not to reproduce the C# method signatures.
The goal was to preserve their behavior using the capabilities of PHP.
The First Review After the DeepSeek conversion, the generated code was reviewed manually.
This was necessary because syntactically valid PHP does not necessarily mean behaviorally compatible PHP.
