PHP Similarities.

Wee

Wee

Associate
Joined
25 Apr 2006
Posts
130
Location
Scotland
Looking at dabbling in some PHP over the coming months, and just wondered if the language shares any similarities with any other language?

From the looks of the code, it looks to resemble JavaScript. Does it?
 
java/c#/c++

Very similar to these, mainly the first 2.

eg.

function_name ($args1, $args2,...$argsn)
{

// do stuff

}

All the switch/if/else are identical.

The only major difference is variable declaration, no types need to be defined:

$variable

Classes pretty similar to java/c# too.

class myClass
{

var $variable

function myClass
{
$this->variable++;
}

}
 
Last edited:
Well it's essentially a Perl rip-off, so that's where most of the similarities lie, but syntactically it is considered "C-style", along with C, C++, C#, Java, Perl etc. Whilst it obviously has its own idiosyncrasies, its syntax should be intelligible to someone with a background in one of the aforementioned languages.
 
Back
Top Bottom