Perl | PHP |
Language features | |
Lexical scoping and dynamic scoping | Functions have unique scopes |
3 different contexts (scalar, list, void) | No context types |
5 different sigils - $,@,%,&,* | One sigil - $ |
Regular expressions part of the language | Regular expressions accessable through functions |
Data | |
Scalars, Arrays, Hashes | Scalars, Arrays/Hash duality |
Type-ignorant with roughly 3 types (string, number, reference) | Type-ignorant with roughly 13 different types (see. is_ functions) |
Explicit references | Optional explicit references |
Pass by value | Implicit (i.e it should do the right thing) |
Functions | |
Can be called with 3 different syntaxes | Called with one syntax |
Anonymous functions part of the language | Anonymous functions from create_function |
Can be referenced | Symbolic calls |
Args implicitly aliased to @_ | Named args |
Objects | |
Created through blessing a reference | Created through new Class |
Multiple Inheiritance | Single Inheritance |
Class variables aren't standard | Class variables part of the language |
This is by no means exhaustive or entirely accurate but should give you some ideas of the fundamental differences between the two languages.
HTH
_________
broquaint
In reply to Re: Re: Re: php + Smarty looks like CGI
by broquaint
in thread php + Smarty looks like CGI
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |