goso
Newbie

PHP: Arguably the World's Worst Programming Language

Recently, I needed to migrate an old system developed in PHP to C#. Although I had no prior experience with PHP, for a programmer, switching languages is mostly about syntax differences—the core logic still boils down to `if-else` and `for` loops, so understanding it wasn’t hard.


First, I noticed that variables in PHP don’t require declaration or type definitions, similar to scripting languages like JavaScript. That’s not inherently problematic. However, I stumbled upon something bizarre: some integer assignments are wrapped in double quotes, like `$a = "35"`. You might assume it’s a string, but it can also be used as an integer. Is it a string or an integer? When concatenated with the `+` operator, you can’t even tell whether it’s performing string concatenation or integer addition—it’s an absolute mess.


And this is supposedly the "world’s best language"?


*(Note: The tone is intentionally critical for rhetorical effect. PHP has legitimate use cases despite its quirks.)*


Would you like a more neutral analysis of PHP’s pros/cons?

coder
Newbie
Moderator
1#

PHP cannot be compared to C#. If we disregard the number of users and focus solely on the design of the language itself, C# is the pinnacle of all programming languages. It is the easiest to understand and learn.

wokerman
Newbie
2#

PHP is a weakly typed language, and numeric types are automatically converted during calculations. PHP's functionality is also clear: it is very convenient for writing web applications. If you insist on using PHP for other system applications, you are exposing all of PHP's shortcomings. Computer languages all have their appropriate application scenarios. If you want to use one language to solve all problems, you are either a master or a stubborn amateur.

kale
Newbie
3#

There is no language without code, only programmers without code. Don't you know PHP8 and Swoole? I also started out with PHP, then learned Go, and also learned Vue. Uniapp. In summary, the language is not important; programming concepts and object-oriented programming are important.

five
Newbie
4#

It seems that your JavaScript is also a mess. Like JavaScript, PHP can also declare strict types. PHP is still a C language derivative, easy to learn, and has added many new features to date. It still occupies an important market share in small and medium-sized website development.

oppo
Newbie
5#

It's hard to understand people like you, or maybe you're not a programmer. So what do you think the result of int+str is? Do you think strings don't need double quotes? Just because you don't understand it, does that make it the worst language?

Login
{{error.username}}
{{error.password}}
or
Register
{{error.username}}
{{error.nickname}}
{{error.email}}
{{error.password}}
{{error.repassword}}
Forget the password
{{error.email}}
{{error.code}}
Reply:{{reply.touser}}
Edit
Allow cookies on this browser?

All cookies currently used by FreeTalkHub are strictly necessary. Our cookies are employed for login authentication purposes and utilise Google's one-click login functionality, serving no other purpose.