in reply to Re: Re: php + Smarty looks like CGI
in thread php + Smarty looks like CGI
| 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: php + Smarty looks like CGI
by Jenda (Abbot) on May 18, 2003 at 16:33 UTC | |
by broquaint (Abbot) on May 18, 2003 at 17:26 UTC | |
by Koschei (Monk) on May 19, 2003 at 05:51 UTC | |
by broquaint (Abbot) on May 19, 2003 at 09:29 UTC | |
by Jenda (Abbot) on May 18, 2003 at 18:16 UTC | |
|
Re: Re: Re: Re: php + Smarty looks like CGI
by Theo (Priest) on May 20, 2003 at 04:26 UTC |