php vs. python. similarities are interpreted, high level languages with dynamic typing are open...
TRANSCRIPT
![Page 1: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/1.jpg)
PHP vs. PythonPHP vs. Python
![Page 2: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/2.jpg)
SimilaritiesSimilaritiesare interpreted, high level languages
with dynamic typing are Open Sourceare supported by large developer
communities are easy to learnare easy to extend in C, C++ and Java are extremely portable. They run on
almost all platforms in existence without recompilation.
support for variable number of function arguments.
![Page 3: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/3.jpg)
SimilaritiesSimilaritieshave the ability to freeze live
objects in a string representation (for storing arbitrary objects on disk, moving them over the network, etc); they can then be converted back to identical objects with data intact.
![Page 4: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/4.jpg)
Differences – What Python Differences – What Python LacksLackssyntax from C and Perl, with lots
curly braces and dollar signs the 'switch' statement and 'do ...
while' construct increment and decrement and
assignment operators (assignment is a statement only in Python)
the ternary operator/statement (... ? ... : ...)
![Page 5: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/5.jpg)
Differences – What Python Differences – What Python LacksLacksschizophrenic tableau of function
names. The builtin library has a wide variety of naming conventions. There are no namespaces, so functions often have prefixes to denote their source (but often not). Functions are often placed into classes to simulate namespaces.
![Page 6: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/6.jpg)
Differences – What Python Differences – What Python LacksLacksa very casual language where all
variables are "set" (to NULL), and a somewhat weak type system (not to be confused with dynamic types)
an expedient (commonly installed) environment
references ('$a =& $b' means that when $b changes, $a changes also)
![Page 7: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/7.jpg)
Differences – What Python Differences – What Python LacksLacksone array type that doubles as a
list and a dictionary. Dictionary keys are iterated in their original order.
private, protected and public modifiers for both properties and methods
abstract and final modifiers for both classes and methods
interfaces
![Page 8: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/8.jpg)
Differences – What PHP Differences – What PHP LacksLacksa general purpose programming
language (not just for the web) indentation is used to mark out
block structure rather than curly braces namespaces and modules
a small core very clear, concise, and
orthogonal syntax
![Page 9: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/9.jpg)
Differences – What PHP Differences – What PHP LacksLacksit is self documenting with
docstrings and pydockeyword arguments to functions
and methods, easy support for default arguments
true object orientation and 'first class' classes and functions
![Page 10: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/10.jpg)
Differences – What PHP Differences – What PHP LacksLacksclasses are used extensively in
the standard librarya notion of private attributesmultiple inheritanceobject-oriented file handling method chainingexcellent introspection
![Page 11: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/11.jpg)
Differences – What PHP Differences – What PHP LacksLackseverything is a referenceone 'del' statement for all data
types.consistent case sensitivity (PHP
functions are case insensitive, but variables are case sensitive)
a simple array slicing syntaxlambdas and other builtin
functional programming constructs
![Page 12: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/12.jpg)
Differences – What PHP Differences – What PHP LacksLacksiteratorsstructured exception handlingoperator overloadingSWIG integration threading an excellent profilerseveral debuggers and IDEslots of high-level data types (lists,
tuples, dicts, mx.DateTimes, NumPy arrays, etc.)
![Page 13: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/13.jpg)
Differences – What PHP Differences – What PHP LacksLacksdifferentiation between arrays (lists)
and associative arrays (dictionaries).
dates that aren't limited to UNIX timestamps (<1970, >2038)
cached byte-code compilationa standardized database APIsupport for all major GUI
frameworksstrong internationalization and
UNICODE support
![Page 14: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/14.jpg)
Differences – What PHP Differences – What PHP LacksLacksmaturity, stability and upward-
compatibilitytends to lead to much more
scalable applications -- importing modules is safer than textually including code as in PHP: global variables are not used to exchange information.
![Page 15: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/15.jpg)
BenchmarkingBenchmarking
![Page 16: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/16.jpg)
BenchmarkingBenchmarking
![Page 17: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/17.jpg)
ConclusionConclusionPHP’s big core uses huge amount
of resources as compared to Python.
![Page 18: PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are](https://reader036.vdocument.in/reader036/viewer/2022062315/5697c0201a28abf838cd1f2b/html5/thumbnails/18.jpg)
ReferencesReferenceshttp://xodian.net/serendipity/
index.php?/archives/27-Benchmark-PHP-vs.-Python-vs.-Perl-vs.-Ruby.html
http://wiki.python.org/moin/PythonVsPhp
http://frcchang.blogspot.com/2005/07/php-note-difference-between-php-and.html
http://www.wellho.net/mouth/67_Object-Oriented-Programming-in-PHP.html