Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
No @ or % variables: PHP has one only kind of variable, which starts with a dollar sign ($). Any of the datatypes in the language can be stored in such variables, whether scalar or compound.
Arrays versus hashes: PHP has a single datatype called an array that plays the role of both hashes and arrays/lists in Perl.
Specifying arguments to functions: Function calls in PHP look pretty much like subroutine calls in Perl. Function definitions in PHP, on the other hand, typically require some kind of list of formal arguments as in C or Java which is not the csse in PERL.
Variable scoping in functions: In Perl, the default scope for variables is global. This means that top-level variables are visible inside subroutines. Often, this leads to promiscuous use of globals across functions. In PHP, the scope of variables within function definitions is local by default.
No module system as such: In PHP there is no real distinction between normal code files and code files used as imported libraries.
Break and continue rather than next and last: PHP is more like C langauge and uses break and continue instead of next and last statement.
No elsif: A minor spelling difference: Perl's elsif is PHP's elseif.
More kinds of comments: In addition to Perl-style (#) single-line comments, PHP offers C-style multiline comments (/* comment */ ) and Java-style single-line comments (// comment).
Regular expressions: PHP does not have a built-in syntax specific to regular expressions, but has most of the same functionality in its "Perl-compatible" regular expression functions.