"PHP-based" PHP-Frameworks vs ASP.NET (Core)

While PHP itself is indeed a good choice for Backend Development (App-/Middle- tier Development) however there remains no reason why “PHP-based” PHP-Frameworks (like, Laravel etc.) should be chosen instead of ASP.NET (Core). I shall elaborate on this after the next paragraph.


For Non-technical- / Student- Readers: Here, from “PHP-based” PHP-Frameworks i mean the PHP-Framework which is another Application / Code (written in PHP-language itself) which will be used by your actual Business Application / Code. As we know that PHP-langauge is an interpreted language hence it is comparatively slower than compiled languages. Why? Because, Programs written in interpreted languages (like, PHP) have to be interpreted into a System-understandable language, just line by line (in code) and that during the execution of Program (Software) whereas the programs written in compiled languages are pre-compiled into system-understadable language completely before execution of the Program). Hence programs written in Interpreted languages happen to be slower than the programs (softwares) written in compiled languages. We now have two PHP-programs (interpreted programs or call it Softwares) one of which is your Business Software which is in turn dependent on the other “huge” PHP Program (Framework Software), imagine what will happen with performance in this scneario? Obviously there will be a significant reduction in performance (Speed as well as over-all Throughout of serving user requests)

(Note: PHP is though the fastest among all other interpreted web-langauges like JavaScript and Python etc. however we are talking about .NET Core here which is compiled through its JIT system)


Back to the main topic …
.NET core (being compiled through JIT and having better Architectures like DDD) beats PHP not because of PHP itself but mainly because of “PHP-based” PHP-frameworks which (unlike, "Compiled PHP-Frameworks as PHP-extensions’) are worst in performance at scale, lack in providing native support for Asynchronous Programming, and offer obsolete Monolithic Architecture (like, Laravel exposes only an MVC-architecture). These PHP-Frameworks are being used more frequently by PHP Developers because they are there for around a decade or more.

For those readers who expect that PHP’s JIT will be of some help, i want to inform that PHP’s JIT is not going to be promising anywhere in near future hence these frameworks are never going to gain much benefit out of PHP 8.0+. Also, no dimension of Scaling can help these thick-layered sluggish PHP-Frameworks at scale and they can not compete with .NET (core) or with Node.js (until PHP-Developers adopt lighting fast, “compiled” PHP Framework like “Phalcon” and “Swoole”; more on this later)

ASP.NET (Core) out-weighs these sluggish “PHP-based” PHP-Frameworks in all aspects including “Portability”, “Scaling”, “Performance”, “Architecture/s”, “Ease of Use (Developer’s Productivity with Visual Studio)” and in its (.NET Core’s) native support to modern Asynchronous Programming Paradigm (This is where only compiled PHP Frameworks like Swoole safe-gaurds PHP-Community; Swoole is most popular, production-ready and time-tested framework).

The only way to sell “PHP” over “.NET (Core)”, while maintaining its (PHP’s) selling point “Ease of Use” is to adopt “compiled PHP-Frameworks as PHP-Extensions” like “Swoole” and “Phalcon”.

Again, PHP’s JIT is not going to be much promising in near future, even if it does it can not beat “compiled PHP-Frameworks as PHP-Extensions” specially “Swoole” which brings many new multi-purpose programming features to the table of PHP-Community / Developers. Asynchrous Programming Paradigm i just one of several features of Swoole; like, support to several Network protocols, multi-threading, multi-processing etc.

See Also:
Dark sides of Laravel

PHP: A Multi-purpose Language