I am working with PHP for a few years and I was very sad because PHP was my pain every day. After moving from PHP to Python more than 2 years ago I can say what I think about Python comparison to PHP:
1. Python has a philosophy that helps to write better to understand the code. 2. Language evolution planning using PEP: You know what you get in the coming years. The PHP development process looks chaotic: making OOP something like Java, then add some “static writing” collections, then include some lambdas (almost after 15 years of development). What’s Next?
3. Python has a more compact and clean syntax that helps developers.
4. In Python the same things can be done in the same way. It doesn’t matter what iterable things you use (list, tuple, dict or something else) that you can always access by index, obtain a portion, iterate on it or get the length the same way.
5. More predictable and stricter. No 1 == “1” and other strange things as in PHP.
6. Python has a more unified and powerful standard library. It has some problems, but the Python library included are much better than PHP.
7. Python better working with exception. And try to improve work with exceptions in future versions. There are no errors as in PHP. Only exception subclasses.
8. Better namespaces and import.
9. Better Oop. All things are objects (but with some limitations for int, flotation, etc.): types, functions, objects, modules
10. Meta classes.
11. A better support of functional programming style.
12. Better Unicode support (much better in Py3K).
13. Sugar syntax for lists, dictionaries.
14. Interactive interpreter mode and few different implementations of improved interactive way.