Which programming language does PHP resemble? Please tell me

Recommended Answers

All 6 Replies

Itself, since PHP is in fact a programming language. One for a specific set of uses, but a programming language nonetheless.

As for which other language it most resembles, that's a bit of a judgement call, really. I would say... well, no, that would be giving you the answer, which I suspect is for a homework question. Given the tags you put, I will say that my personal answer is 'none of those three'.

Mind you, this question doesn't makes much sense as homework, but it doesn't make sense in any other context, either, so I am puzzled as to why either you or your professor would think this is relevant.

commented: Not useful: Yes, it's a judgement call, but you just poke fun at the legitimacy of the question and then refuse to give your opinion -8

https://en.wikipedia.org/wiki/PHP gives a history of PHP and frankly it's none of the ones you noted. It appears to be a new organically grown language that wasn't intended to be a language at all.

commented: Untrue -8

Back when I was in high school and college, I was really into C++ and I wanted to eventually be a low level software engineer. My college friend Dan was really into web development and was encouraging me to get into web development as well. Specifically, he was really into web-based forums and thought it would be great if I created a forum for computer science students to get help from each other. At the time, he was going through phases where he was spending a few months really, really into PHP, then suddenly he was all about Coldfusion, then .NET ... I think today he still does .NET actually.

Web development was a whole new world to me, and I wanted an easy learning curve. I decided to pick up PHP because I was drawn to articles I read about how the syntax was designed to be very C-like, some of it actually based off of C++, and so I thought it would be a good segue into web development. (Specifically, how classes/objects are available but optional, unlike a language like Java where everything needs to be encapsulated in a class.)

Nowadays, PHP has evolved considerably, and IMHO it's doing a good job competing against other modern web development languages such as javascript. Especially PHP 7 and PHP 8 have adopted a lot of characteristics you find in many other modern languages. My code today is, of course, fully object oriented. Some of the more popular PHP frameworks out there nowadays have so many levels of abstraction you end up feeling like you're writing high level Java.

As to answer Schol-R-LEA's question as to why someone might ask which programming languages resemble each other, it could be because they wish to explore other languages that include paradigms they are already familiar and/or comfortable with.

For example, if I want to learn another programming language, but don't have a specific one in mind, I might think a good place to start would be to look into what other languages resemble what I'm already familiar with (which has been only PHP for the past 20 years now).

I just want to also point out that the very first version of PHP was written in C and was mostly a suite of wrappers around C functions. Eventually, as it evolved into a proper language in its own right, as noted in History of PHP on the official PHP website, "the language was deliberately designed to resemble C in structure, making it an easy adoption for developers familiar with C, Perl, and similar languages."

What part is untrue?

Early PHP was not intended to be a new programming language, and grew organically, with Lerdorf noting in retrospect: "I don't know how to stop it, there was never any intent to write a programming language [...] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way."[18] A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997.

What part is untrue?

That PHP does not resemble C, C++, or Python. The first mainstream versions of PHP were purposefully designed to resemble C/C++, and modern PHP has evolved by taking a lot of notes from Python.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.