ไปเจอมาหวังว่าคงช่วยคลายข้อข่องใจได้ระดับนึง

Python vs. PHP
Introduction

Every month or so someone posts to comp.lang.python asking how Python compares to PHP. Python's 'language comparisons' page doesn't have an entry for PHP so here's a first draft. This work-in-progress compares PHP and Python and evaluates their relative strengths for web development.

Please contribute! Once there's some flesh on this skeleton, I'll tidy it up and submit it to: http://python.org/doc/Comparisons.html

-- TavisRudd? - 23 Nov 2001 -- MikeOrr - 15 Dec 2001 -- DiogoResende - 21 Jun 2007
Common Ground

Both PHP and Python:

* are interpreted, high level languages with dynamic typing
* are OpenSource (except PHP's ZEND compiler?) ("Zend Compiler" doesn't exist)
* are supported by large developer communities
* are easy to learn (compared to Java, and even Perl)
* are 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.
* have 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. PHP's serialize function; Python's pickle and marshal modules. Note that PHP, handling of serialized objects and classes is much weakier and error prone than Python's due to PHP's lack of modules. When an object is serialized, only its attributes are stored, not its methods. Thus, the object's class must be present (with the exact same name) in the script that unserializes it. In Python this is handled automatically via the module/import framework. (this COULD be handled with PHP 5's __autoload(), but is not done


http://wiki.w4py.org/python-vs-php.html