24
Medien- und Kommunikationsinformatik Hochschule Reutlingen [email protected] Abstract: The goal of this document is to offer a direct comparison of the programming languages PHP and Python and to check if an empirical and situational decision can be made about the superiority of one of the languages over the other. The findings of this study are based on the current stable releases of these languages, which are PHP 5.3.6 and Python 3.2., as these are likely to present the current state of the art of their underlying technologies. The conclusions is based on a number of different factors that can be deemed useful for deciding what language to choose for a certain purpose. The research covers a wide area of relevant topics instead of focusing on a single one. 1. Preface To understand the status quo of PHP and Python it may be useful to first know about the origins of both languages. 1.1 A Brief History of PHP PHP was initially developed as a set of PERL scripts to create simple dynamic websites by Rasmus Lerdorf in 1995 [PHP2011-26]. After a reimplementation and expansion in C and a source release, it quickly gained popularity to be present on 1% of the internets domains by 1997 [PHP2011-26]. Andi Gutsman and Zeev Suraski decided to collaborate with Lerdorf to improve PHP, as they considered it underpowered for eCommerce use, resulting in the development of PHP 3, which is the basis of what PHP is today [PHP2011-26]. In 1998 Suraski and Gutsman rewrote the PHP core and developed the Zend Engine [PHP2011-26]. By 2001 PHP had developed into more than a language for dynamic websites with the first release of PHP-GTK, which enables developers to write standalone GUI applications in PHP [PHP2008]. Today, with PHP 5, it runs on the Zend Engine 2.0 [PHP2011-26]. 1 PHP vs Python: A Decision Greg Rauhöft

Php vs Phyton

Embed Size (px)

Citation preview

Page 1: Php vs Phyton

Medien- und KommunikationsinformatikHochschule Reutlingen

[email protected]

Abstract: The goal of this document is to offer a direct comparison of the programming languages PHP and Python and to check if an empirical and situational decision can be made about the superiority of one of the languages over the other. The findings of this study are based on the current stable releases of these languages, which are PHP 5.3.6 and Python 3.2., as these are likely to present the current state of the art of their underlying technologies. The conclusions is based on a number of different factors that can be deemed useful for deciding what language to choose for a certain purpose. The research covers a wide area of relevant topics instead of focusing on a single one.

1. Preface

To understand the status quo of PHP and Python it may be useful to first know about the origins of both languages.

1.1 A Brief History of PHP

PHP was initially developed as a set of PERL scripts to create simple dynamic websites by Rasmus Lerdorf in 1995 [PHP2011-26]. After a reimplementation and expansion in C and a source release, it quickly gained popularity to be present on 1% of the internets domains by 1997 [PHP2011-26]. Andi Gutsman and Zeev Suraski decided to collaborate with Lerdorf to improve PHP, as they considered it underpowered for eCommerce use, resulting in the development of PHP 3, which is the basis of what PHP is today [PHP2011-26]. In 1998 Suraski and Gutsman rewrote the PHP core and developed the Zend Engine [PHP2011-26]. By 2001 PHP had developed into more than a language for dynamic websites with the first release of PHP-GTK, which enables developers to write standalone GUI applications in PHP [PHP2008]. Today, with PHP 5, it runs on the Zend Engine 2.0 [PHP2011-26].

1

PHP vs Python: A DecisionGreg Rauhöft

Page 2: Php vs Phyton

1.2 A Brief History of Python

Python was developed from its conception by Guido van Rossum in 1990 [PSF2011-24] as a general purpose, open source [PSF2011-25] scripting language. In the year 2001 the Python Software Foundation (PSF) was founded [PSF2011-25] as a non-profit organization to “promote, protect and advance the Python programming language” [PSF2009]. 2008 saw the latest major Python release with Python 3.0 [PSF2011-25] that also broke backwards compatibility [PW2011]. Although the Python 2.x branch is still being developed, it will be phased out and replaced by the Python 3.x branch [PW2011].

1.3 Introduction

Albeit PHP formerly being a specialized language for the easy creation of dynamic websites, it has steadily developed in to a general purpose language that matches Python in feature completeness and maturity. While PHP is still mainly used as a server side scripting language it is no longer described as only such on its official website, also citing its CLI and PHP-GTK features [PHP2011-27]. Python was developed as a general purpose language from scratch so it has never been pressed in to a certain niche. Due to these circumstances this study will focus primarily on what PHP has gained on Python regarding general purpose programming. Only in server-side scripting sector will we concentrate on how Python matches up with PHP. Concerning the general language features both languages will be treated as equal.To compare both languages, certain aspects, such as language features and uses common to both languages, will be compared directly. This is by no means complete or definitive, but merely an overview, as comparing all features would exceed the limitations of this document.The criteria for the choice of language aspects to compare is based on practical considerations to be taken towards the application of programming languages in general. This is separated in to two parts: General features belonging to the language and uses of the languages. In the overview of the language, documentation was considered a comparable aspect, as a poorly or incompletely documented language is harder to use, cannot be utilized in its entirety and the outcome of a program may be unexpected, creating an insecure liability for the producers and customers alike. In addition, the syntax of the languages was taken in to consideration, as a clear and simple syntax can make it easier for other people to read and understand the code, making code reviews and programming in a team easier. To provide insight in to alternative usage scenarios of the language, a review of the various implementations of both languages is provided. In more technical terms, garbage collection is an aspect of a language that is especially important for long running programs that frequently create objects. As such it should be taken in to consideration when comparing languages for general programming use. This goes hand in hand with the languages type system, as a weak typing system, especially in an object oriented language, can lead to errors that are not necessarily obvious and, as such, hard to find. As dynamic languages are often used as embedded scripting languages that may also require

2

Page 3: Php vs Phyton

an extended feature set, embeddability and extensibility will also be taken in to account. The final aspects taken reviewed in the language section are the programming paradigms that can be used with the language and how these can be utilized. These include the object oriented (including instances and inheritance), functional and concurrent paradigms.Concerning the usage of the languages, the most important one for comparison purposes may be with web servers, as this is where PHP is most commonly used. Regarding the LAMP stack the comparison will go in to more detail, as the “P” in LAMP can stand for PHP or Python (or PERL for that matter). The CLI features of the languages will also be considered, because this most basic form of human-computer interaction supplies output for developers and can be an important debugging and testing tool. Not to mention the programs that actually use the command line for all their interactions, as they may lack a GUI. To expand upon this, the use of the languages for standalone applications will be compared, as the use of a general purpose programming language should go beyond being embedded or called to perform a certain task for its host program. To perform any general work in a production environment, a rich set of libraries should be available to perform various tasks. Rewriting everything a project may require is not a feasible task and a waste of time, so an overview of a diverse set of libraries will also be given.As seemingly no citation-worthy literature comparing PHP and Python has previously been written, most points of criticism are taken from examining their respective official documentation and websites and comparing these.

2. Language

2.1 Documentation

PHP has a single documentation that covers all versions from 4.1.0 to 5.x.x [PHP2011-1]. Version specific information is on the same pages as general information. Despite being very extensive, covering all the topics necessary to understand the language, it lacks a formal language and grammar description in a BNF-like way. This can only be acquired by downloading the PHP source code and reading the parser specific source files contained within it. At the time of writing large parts of the documentation were also incomplete, especially regarding the internals of the Zend Engine [PHP2011-2]. The PHP documentation also features a system for user contributed notes, which allows users of the language to add their own experiences about the presented topic, giving hints to pitfalls and common usage scenarios [PHP2011-3].Python has separate documentations for every version, salvaging the documentation of previous versions for unchanged features. It uses a modified BNF grammar notation for lexical analysis and syntax description. [PSF2011-1]As the documentations for both languages are very extensive and feature examples and tutorials, it makes it easy for programmers to learn the languages. The large library references enable programmers to extend their knowledge and solve specific tasks quickly with the tools the languages have to offer. Although PHP's policy of having one

3

Page 4: Php vs Phyton

documentation for all versions makes it easy to see where differences occurred, it does clutter up the pages and since programmers are likely to use one version of a language to perform one specific task, the Python documentation is more concise. Both the PHP and the Python documentation offer lists of update notes that show where differences to previous versions are. This is likely to be the better approach. The lack of an easy way to access PHP's formal syntax description makes it unnecessarily hard to fully understand how the language works in detail and to implement custom parsers or syntax highlighters, and the lack of proper documentation of the Zend Engine's internals makes it unnecessarily hard to extend and embed PHP. It seems PHP's lacking official documentation is compensated through a large amount of third party books. A search on amazon.co.uk in the “Computing & Internet” section returns 8703 results for “PHP” and only 3209 results for “Python” (data from 11.08.2011). Interestingly enough, a search of the “IEEEXplore Digital Library” (http://ieeexplore.ieee.org) returns almost the same amount of results for “Python” (270 results as of 12.08.2011) as it does for “PHP” (285 results as of 12.08.2011) in the “Computing and Processing” section, hinting that both languages garner about the same amount of academic interest.

2.2 Syntax

PHP was designed to be easily embeddable in documents containing other data than only PHP code. It is for this reason that even a pure PHP file contains a slight overhead in tags marking the beginning and end of a PHP section (commonly <?php and ?> respectively). The trivial case of a pure PHP file will have the opening tag right at the beginning and the closing tag right at the end of it while a file can be filled with an otherwise arbitrary number of opening and matching closing tags, as the PHP parser ignores (or outputs) everything outside of them [PHP2011-4].The general syntax features elements from C, Java and PERL and as such is dominated by C-like braces, Java-like keywords and PERL-like variables [PHP2011-5]. The PHP grammar contains inconsistencies in case sensitivity though. As such “the variable names are case-sensitive but the function names are non-case sensitive” [Cho08, p. 3].A very different approach was taken with Python's syntax. Instead of using braces for structuring code, it uses different levels of indentation. This causes Python to enforce an implicit coding style, as variations in indentation can either lead to errors or to semantic differences [PSF2011-2]. Furthermore, many of Pythons operators can either be written as symbols or as words, enabling programmers to adopt a coding style that looks and feels more like a set of English sentences [PSF2011-3]. While PHP's syntax makes it easy for Java and C programmers to migrate to PHP, due to it's familiar look and feel, it does nothing new for readability. Due to Python forcing a certain coding style upon programmers it can make code easier to maintain, as it isn't necessary to get accustomed to another programmer's coding style when reading foreign code. Indentation is a common coding style taught in programming courses and can make code easier to read. Python's dependence on indentation removes an error source that remains in PHP.

4

Page 5: Php vs Phyton

2.3 Implementations

The standard Python implementation is called CPython and is, as the name might imply, written in the C language. [PSF2011-1] To broaden Python's range of usefulness, several other Python implementations were developed, targeting specific platforms, including Java with Jython and the .NET Framework with IronPython. These platform-specific implementations were written in the corresponding target platforms primary languages, Java [JWBSN2010] and C# [IP2011] respectively, and make use of their runtime environments, the Java Virtual Machine [JWBSN2010] and Microsoft's Common Language Runtime [IP2011]. As such, Jython and IronPython have access to their host environments libraries and vice versa [JWBSN2010][IP2011].A different approach was taken by the developers of the PyPy Python implementation. PyPy's implementation language is a subset of Python its self, called Rpython, which can be converted to C code and compiled natively [PP2011-2]. It claims to be faster than CPython in many benchmarks, as it uses Just-In-Time compilation or can be used stackless to run with micro threads [PP2011-1]. Furthermore PyPy can also run on the Java Virtual Machine and in Microsoft's Common Language Runtime [PP2011-1]. Stackless Python is a Python implementation that was specifically written to “reap the benefits of thread-based programming without the performance and complexity problems associated with conventional threads” [SL2011-1]. This subject will be covered in more detail in the section of this paper about concurrency.The standard implementation of PHP comes in the form of the Zend Engine 2 as of PHP 5 [PHP2011-6]. It was written in the C language. PHP also has a range of alternative implementations opening the language to different usage scenarios. Project Zero, a “technology incubator project” [PZ2008-1] for IBM's “WebSphere sMash” [PZ2008-1] contains an implementation written in Java [PZ2008-1], that still lacks the PHP function library, as the focus was on “language level constructs” [PZ2008-1] up to now. It does, however, allow programmers to write PHP extensions in Java [PZ2008-1].Phalanger is a compiler for PHP, that translates PHP into the Microsoft Intermediate Language to run on Microsoft's Common Language Runtime [PH2011-1]. As such, it also allows for using objects written in other .NET languages to be accessed from PHP and vice versa [PH2011-1].Developers at facebook wrote a compiler for the PHP language called “HipHop” that allegedly “transforms PHP source code into highly optimized C++” [HH2011-1], while removing and replacing certain features of the language [HH2011-1].PHP's lack of a formal syntax description makes it hard to write other implementations of the language, which is evident by the lack of complete alternative implementations, thus limiting PHP's usefulness as a multi-purpose scripting language. Python's implementations allow for a wide range of usage scenarios and can easily be used in projects that require the cooperation of multiple programming languages.

2.4 Garbage Collection

Python's main method of garbage collection is by reference counting [PSF2011-4].

5

Page 6: Php vs Phyton

Every object has a counter for the number of variables referencing it [PSF2011-4]. As soon as the reference count reaches zero, the memory is freed [PSF2011-4]. In addition Python also has a cycle detector to detect if a reference to an object is directly or indirectly to its self [PSF2011-4]. Once detected it can free these cycles as soon as they aren't referenced from anywhere else [PSF2011-4].Python's garbage collector can be controlled, activated or deactivated and run via its Garbage Collector Interface, called “gc” [PSF2011-5]. In addition it “provides access to unreachable objects that the collector found but cannot free” [PSF2011-5] as well as access to a list of all objects tracked by the collector [PSF2011-5]. Furthermore, debugging of the garbage collection process can be enabled from within Python, offering information about leaks, collectable and non-collectable objects and general collection statistics [PSF2011-5]. The collection threshold that decides when the garbage collector is run can also be set at runtime [PSF2011-5].PHP also uses reference counting for garbage collection along with cycle detection for self referencing objects [PHP2011-8]. It frees memory as soon as a request ends or the reference count reaches zero [PHP2011-8]. PHP user control for the garbage collector is more limited. It only allows to be instructed to be enabled, disabled or run [PHP2011-7]. By default the garbage collector in PHP runs when 10.000 roots are created [PHP2011-8]. This constant cannot be altered at runtime or in any PHP settings. It requires a change in PHP's source code and a subsequent recompilation [PHP2011-8].Despite PHP and Python using similar approaches for garbage collection, the greater control Python offers over the process allows for more precise optimization of it. The information Python's garbage collector offers at runtime can allow for dynamic collection optimization and highlight leaks and shortcomings in efficiency that aren't currently possible with PHP's implementation. Also, the fact that PHP's collection frequency cannot be tweaked, except through the recompilation of the entire source code, makes PHP less suitable for long running applications, such as GUI or server applications.

2.5 Type System

PHP is a weakly typed language, which allows for something the PHP manual refers to as “type juggling” [PHP2011-9] which is the implicit conversion between various primitive and abstract data types through operators [PHP2011-9]. As such, PHP throws no exception and generates no warnings if, for example, the instance of a class is added (+) to the instance of another class, which produces the counter-intuitive result of an integer with the value of 2. PHP also allows for explicit type casting to primitive types following a syntax equivalent to the one used in C. This can also lead to counter-intuitive results, such as the conversion of the empty string or a string with the value of “0” both evaluating to false if casted to a boolean [PHP2011-10].Python uses strong typing as well as duck typing as its typing disciplines. So in spite of operations on primitive types requiring explicit type conversion (e.g. int(“5”)+5) [PSF2011-8], methods with the same names and signatures from different classes can be called in the same way without prior casting and without sharing a common base class

6

Page 7: Php vs Phyton

declaring said methods [PSF2011-7]. This allows for a kind of polymorphism that doesn't rely on inheritance [PSF2011-7], which can flatten an inheritance tree if used accordingly. Type conversion works in an object oriented manner in Python, as the type conversion operators are simply calls to the corresponding built in types constructors (such as int()) [PSF2011-6, int].Seeing as PHP was initially developed for server side scripts where security is crucial, it's weak typing discipline seems dangerous and out of place, as errors caused by unchecked and accidental type conversions are not only hard to find but can also lead to unexpected behaviour and results [Cho08, p. 1]. Python's approach inhibits this kind of danger by requiring explicit type conversions, thus making it harder for unwanted or accidental conversions to go unnoticed. Furthermore, Python's approach to type conversion via constructors instead of a separate language construct as it is in PHP is more consequent and fits into the nature of the language, where everything is an object.

2.6 Extensibility

Python offers two distinct ways to extend the language. The first one is through using Python's C API to define a new module [PSF2011-10]. This enables Python to call native C code [PSF2011-10]. The second one is through using Python's “ctypes” module, which is part of its Generic Operating System Services [PSF2011-9]. This module “provides C compatible data types, and allows calling functions in DLLs or shared libraries” [PSF2011-9], thus allowing programmers to wrap functionality written in C in Python code. Similarly to Python, PHP's Zend engine also offers a C API for programming extensions in C and allows the calling of C code from within PHP [PHP2011-2]. As large parts of the documentation about the Zend engine's internals are missing [PHP2011-2] at the time of writing, no further judgement can be made about it at the current time.Extending PHP and Python requires a similar amount of effort from sides of the programmer and works very similarly in code. Python's ctypes module, however, can make the portation of existing libraries significantly easier. The lack of a complete documentation for PHP's Zend Engine's internals makes learning the skill of extending the language more troublesome than with Python.

2.7 Embeddability

Python offers two separate ways to be embedded in other applications. The first one is called “Very High Level Embedding” [PSF2011-11]. It allows a string of Python code to be sent directly to the Python interpreter without using system calls [PSF2011-11]. This doesn't allow for direct interaction with the Python application though [PSF2011-11]. To achieve this, Python offers a method called “Pure Embedding” [PSF2011-11]. It works like extending Python, with the exception that Python code is called from C code instead [PSF2011-11]. Through the combined use of “Pure Embedding” and Pythons C API, mutual communication between the two languages can be established.

7

Page 8: Php vs Phyton

Embeddability is an undocumented feature of PHP at the time of writing. The source distribution of PHP contains a SAPI called “embed”, yet it contains a warning to users about it being experimental and likely to change or be converted to an extension [EK2011].As embedding PHP is undocumented and still in an experimental phase, Python should be the language of choice for anyone wanting an embedded language to enhance the functionality of a program.

2.8 Paradigms

2.8.1 Object Orientation

Despite supporting classes, Python's default means for data encapsulation are lacking. Python doesn't contain a concept of protected members and private members are simply preceded by two underscores ( __ ), which cause the members names to be combined with the class name before code generation to form a name resembling _classname__membername [PSF2011-12, private]. The consequence of this is that the access to private members isn't actually forbidden, as the member can still be accessed through the mangled name. It is solely at the programmer's discretion to avoid accessing private members [PSF2011-12, private]. Python also offers properties similar to those seen in C# as a means of access control or member protection as well as for clean-up and creation actions [PSF2011-6, property]. These properties still rely on a private member variable to be used, which can still be altered by the aforementioned method. Furthermore, member methods have to explicitly name the reference to their containing instance as their first parameter, leading to redundancy in code [PSF2011-12, Random Remarks]. When calling a member method, it is not necessary to explicitly pass the containing instance, as Python considers an instance.method() call to be the equivalent of class.method(instance) [PSF2011-12, Method Objects]. Python allows the definition of meta-classes to customize class creation [PSF2011-13, Customizing Class Creation]. Every class has a meta-class by default, but allows for new ones to be written and assigned and are also inherited from base classes where applicable [PSF2011-13, Customizing Class Creation]. The customization features include the control over instantiation of classes [PSF2011-13, Customizing Class Creation] and even to completely deny it (by overwriting the __new__ function), as well as controlling the inheritance from base classes (by overwriting the __prepare__ function) [PSF2011-13, Customizing Class Creation].The PHP approach to object orientation closely resembles that of Java. Encapsulation modifiers are placed directly in front of the member and include public, protected and private [PHP2011-11]. These work as expected with public being the default modifier and visible inside the instance as well as from the outside, protected being visible to subtypes and private being visible only to the containing instance [PHP2011-11]. As PHP forbids identifiers from standing alone, modifiers also offer a means of declaring a variable without having to initialize it [PHP2011-12]. PHP's encapsulation features appear to be rather secure, with the only obvious means of circumventing them being

8

Page 9: Php vs Phyton

reflection.The judgement over which programming language offers better features for Object Orientation depend on whether or not strict encapsulation should be considered a language feature or a project specific programming guideline. Considering the dynamic nature of both languages, that encourage programmers to take different approaches to solving problems efficiently and easily, the non-strict variant that Python takes is likely to work out better. Furthermore, Python allows for complete control over class creation by using meta-classes, so specific rules can be implemented depending on its use. PHP lacks this feature.

2.8.1.1 Instances

In Python instances of classes can easily be extended and functionality altered by simply assigning a value to an arbitrary identifier. Where x is not an element of the class's members and y is an expression, the following statements adds a member to this specific instance: instance.x = y [PSF2011-14]. The same statement with x as a member of the class would override the instance's x with the result of y [PSF2011-14]. As much as this offers a very dynamic tool to work with, it can also create problems. Typographical errors on the left side of an assignment do not lead to an error message by default, thus being prone to errors which can be hard to debug. It also offers a way to extend classes without the use of inheritance, functionality can be altered unknowingly. This functionality can be disabled by defining an attribute setter and deleter (__setattr__ , __delattr__ [PSF2011-13, Customizing Attribute Access]) for a given class. If the functions body is left empty, it prevents the assignment of a value to a previously non-existent identifier, thus preventing the alteration of an instance.Instances in PHP can also be altered by means of assigning a value to an arbitrary identifier that isn't contained in the set of class variables of the instance's class [PHP2011-13]. This counts for assignments within as well as outside of the instance its self. If a variable is declared as private or protected and an attempt is made to change its value from outside of the instance, the program ends with a fatal error [PHP2011-11] , as a Java or C++ programmer would expect. Similarly to Python's behaviour,, PHP offers magic methods that can be used to bypass this restriction. Defining a general attribute getter and setter for the class (__set, __get [PHP2011-13]) to simply assign a passed value to an identifier, or return the value of the requested identifier respectively, breaks any access modifiers [PHP2011-13]. Like in Python, an empty function body can be used to ignore any assignments to identifiers and create an instance filled with constants.Considering the dynamic nature of the PHP language, it seems illogical to allow adding variables to an instance from the outside but restricting this feature to variables that aren't declared as private or protected within the original class, as these shouldn't be visible from the outside anyway. Python takes this into consideration through its name mangling mechanism, as private members receive an internal name that differs from the name they originally received in the class definition, thus not restricting these kinds of assignments in PHP's manner. PHP's unnecessary confirmation of the existence of internal private or protected variables seems to have passed over from Java or C++

9

Page 10: Php vs Phyton

without taking the actual necessity for this into consideration. Using PHP's magic methods, it should be possible to create a custom name mangling system similar to the one present in Python.

2.8.1.2 Inheritance

Python supports the concepts of inheritance [PSF2011-12] and multiple inheritance [PSF2011-12] and allows for overriding inherited methods and attributes [PSF2011-12], and, due to its dynamic nature and unlike in Java, inherited class features can be removed. This goes hand in hand with Python's two type-checking functions isinstance and issubclass, to check if a variable is of a certain type or subtype [PSF2011-12]. To support multiple inheritance, Python uses depth-first, from left to right search in order of base class declaration to find members throughout the base classes [PSF2011-12]. This is enhanced by a dynamic restructuring of the base classes to avoid the diamond relationship problem [PSF2011-12]. The concept of abstract classes can be implemented through meta-classes and a pre-implemented abstract base class meta-class exists in Python's standard library [PSF2011-15].PHP also supports inheritance using the same syntax present in Java, through the extends [PHP2011-15] keyword, but like Python, inherited members can be forgotten if necessary. If a class is derived from another, it inherits all public and protected members of the base class [PHP2011-14]. Abstract classes can be created using the abstract keyword, preventing underived instantiation [PHP2011-16]. Also like Java, interfaces can be defined in PHP, allowing a programmer to declare a set of unimplemented public functions to be implemented by any class using the interface [PHP2011-17]. At present, PHP offers no predefined means for multiple inheritance.PHP's inheritance mechanism is closely modelled on Java's (including the keywords), thus inheriting some of the shortcomings of Java's inheritance mechanism, such as the lack of a means for multiple inheritance. The benefit of this is an easy transition for programmers coming from Java or C# to PHP's approach to object oriented inheritance. Despite Python not sharing any inheritance specific syntax elements with Java, thus creating a shallower learning curve for people coming from a Java background, its intuitive and logical means for multiple inheritance make it more versatile than PHP, especially if the use of multiple inheritance is deemed necessary.

2.8.1.3 Exception Handling

Python uses a form of exception handling that should be familiar to anyone who knows Java. An exception is a class that can be extended to create custom exceptions. Exceptions can be thrown and caught [PSF2011-26]. An uncaught exception leads to the termination of the program [PSF2011-25]. What separates Python from Java is the syntax of Exception controls. Exceptions are thrown by “raising” them (raise keyword) and caught by “excepting” (except keyword) [PSF2011-25]. The finally block is the same as in Java, which is executed regardless of whether an exception occurred

10

Page 11: Php vs Phyton

[PSF2011-25]. Vulnerable code sections, expecting a possible error are placed in a try block [PSF2011-26]. Python also has built-in exceptions that are thrown if a runtime error occurs [PSF2011-26][PSF2011-25].PHP doesn't only share the usage of Exceptions with Java, it also shares the syntax. They are thrown my using throw, caught by using catch and expected with a try block [PHP2011-28], but PHP completely lacks the finally block [Dop10, p. 287]. Furthermore exceptions were not always a part of the PHP language, only being introduced in version 5 [PHP2011-28]. This leads to the problem that PHP has two kinds of runtime errors: those that can be caught, using the new exception system and those that simply display a warning or cause the program to crash in the worst case [PHP2011-28].Despite Pythons syntactical differences, its usage should be familiar to Java and C# programmers, while PHPs lack of certain exception handling features can be unintuitive. The lack of a finally block denies a programmer the possibility to define a block of code to be executed regardless of whether an error occurred, which can lead to code duplication for the normal program path and the catch block as well as instability in long running programs [Dop10, p. 287]. Furthermore, PHPs inconsistent use of catchable exception creates a possible cause of program crashes that is harder to avoid at runtime.

2.8.2 Functional

PHP supports closures which lays the foundation for programmers to use the functional paradigm [PHP2011-18]. Functions can accept other functions as parameters and are also able to create and return functions [PHP2011-18]. PHP doesn't require a name to be given to a function [PHP2011-18] or for it to be predeclared.Python supports anonymous functions in form of lambdas [PSF2011-16]. This functionality is restricted by allowing lambda expressions only to contain other expressions and not statements [PSF2011-16]. But as the pure functional paradigm doesn't include states, Pythons lambda enforces this rule. Lambdas are currently the only way for anonymous functions to be created in Python, but named functions may be passed as parameters as well, yet have to be predeclared [PSF2011-17].PHP's anonymous function mechanism may offer the programmer greater flexibility, but defining functions in this manner can easily lead to code that is hard to read. Due to Python restricting it's anonymous functions to contain only expressions and not statements, it keeps them short, easier to read and avoids state changes. The enforcement of the expression only rule also makes Python's lambdas suitable for academic use, as they work exactly how a student of the lambda calculus would expect and preserves the rules of pure functional programming.

2.8.3 Concurrency

Concurrency is featured in Python as “Optional Operating System Services” [PSF2011-18], meaning it is only available on certain operating systems. Python's standard implementation, CPython, contains a performance based restriction called “Global

11

Page 12: Php vs Phyton

Interpreter Lock” [PSF2011-18]. This restriction only allows one thread to execute Python byte code at a time [PSF2011-18]. As such, concurrency is only possible by means of multiprocessing (using Python's multiprocessing module [PSF2011-19]) by default [PSF2011-18]. The aforementioned Stackless implementation of Python adds full threading support to the language in form of microthreads (“Tasklets” [SL2011-1]), including communication between threads [SL2011-1], scheduling and thread serialization [SL2011-1].Concurrency in PHP is disabled by default and must be compiled with a certain switch to activate it [PHP2011-19]. It is only available on Unix platforms and only by means of multiprocessing [PHP2011-19]. PHP does, however, allow multiple copies of PHP to run in the same thread (the opposite of Python's “Global Interpreter Lock”), so care must be taken when defining global variables when writing extensions for PHP [PHP2011-20].Despite Python's standard implementation not supporting true threading for good reasons, the Stackless implementation makes up for these shortcomings. PHP has nothing to offer regarding true threading and neglects the danger of hard to find errors which comes with global variables when running several instances in the same thread. Furthermore, according to Cholakov, PHPs lack of true multithreading “is going to be a major vulnerability for the platform in the very near future” [Cho08], as “reasonable (and constantly dropping) prices of these components give a good sign that even the smallest companies will tend to use multiple cored Web servers” [Cho08].

3. Uses

3.1 Web Servers

Not necessarily a language feature, a Python enhancement proposal was created and approved in 2003 [PE2003] and extended to improve usability in Python 3 in 2010 [PE2010] to create a Web Server Gateway Interface (wsgi) specification “for web servers and application servers to communicate with web applications” [WSGI2010]. It is supported by a number of web-frameworks, such as Django, Pylons, Zope 3 [WSGI2011] and Apache (through mod_wsgi [GD2011]). Python contains a reference implementation of the wsgi specification that can assist in writing wsgi enabled applications [PSF2011-20].PHP provides a range of SAPIs to communicate with servers that are included in the official source distribution [PHP2011-21]. These include Apache, Litespeed among others and hook directly into the specific servers [PHP2011-21].PHP's compatibility with Web Servers is where it excels, probably because it was initially designed to perform web-based tasks. But while PHP's SAPIs have to be rewritten for every server, Python's WSGI aims at offering a common interface for application-server and server-server communication.

12

Page 13: Php vs Phyton

3.1.1 LAMP

Python support for the LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack was initially introduced by the mod_python project, allowing the Python interpreter to run as a module in Apache [AS2010]. The Apache Quetzalcoatl project was “charged with the creation and maintenance of open-source software related to mod_python and the Python programming language” [AS2011] , but was cancelled due to community inactivity [AS2011] . The official mod_python project page claims that the project isn't dead, but in a state that is mature enough to require very little maintenance [AS2010].An alternative is to use mod_wsgi, an Apache module that supports Python's Web Server Gateway Interface [GD2011].PHP's Apache module (mod_php) is provided along with the PHP source code [PHP2011-21] and can be connected to Apache after being built with switches to enable Apache specific extensions [PHP2011-22]. A pre-compiled set of Apache, MySQL and PHP/Perl comes in form of XAMPP for various operating systems to make the installation easier. The Apache mod_python seems to be obsolete as it's parent project was cancelled, while mod_php is still the most commonly used Apache module. The mod_wsgi, however, offers consistency for the communication with any web-server that implements it, which makes it an interesting alternative.

3.2 CLI

By default Python has several ways it can be used with a command line interface. The Python executable run without parameters puts Python in an interactive console mode [PSF2011-21]. This allows programmers to write a line of code and receive direct feedback about syntactical correctness as well as the result of any expression entered [PSF2011-22]. In this mode it can also be used as an advanced calculator [PSF2011-22] due to Python's large mathematical library. Anything written into the console during a session persists until the session ends [PSF2011-22]. The Python executable followed by the path of a Python file runs the contained program, which can then access the standard in- and output and use it for user interaction [PSF2011-21].The IDE that ships with Python, IDLE, comes with a built-in command line [PSF2011-23]. The functionality is the same as Python running in the interactive console mode, with the additional features of being able to retrieve previous commands, as well as the ability to save the interactive session, which can be fully recalled [PSF2011-23].PHP's CLI SAPI is the default to be built along with the CGI SAPI when configuring PHP without options [PHP2011-23]. Like Python, the PHP executable can be followed by the path of a PHP file to run the contained program [PHP2011-25]. The CLI can also be run with the -a option to receive an interactive shell [PHP2011-24]. The precondition for this is that PHP was compiled with the –with-readline option, otherwise the shell will not be able to pass the input to the PHP interpreter [PHP2011-24]. It also contains a peculiar exception to PHP's opening and closing brackets rule, in that commands sent

13

Page 14: Php vs Phyton

directly to the interpreter in this manner don't have to be surrounded by them [PHP2011-24].Python's CLI features are very sophisticated and work out of the box while PHP's require a specific configuration before compilation to offer a similar amount of features.

3.3 Standalone Applications

Beyond the previously mentioned CLI uses of PHP and Python, both languages have several other ways they can be used to write standalone applications, mainly in combination with external libraries. These include various GUI toolkits that will be discussed in the libraries section of this document.

3.4 Libraries

As Python 3 broke backwards compatibility with previous versions, thus also breaking compatibility with many previously available libraries (modules in Python), the following section will ignore whether or not the mentioned libraries are Python 3 compatible or not. There are a number of modules to provide the use of GUI toolkits, such as GTK with PyGtk [PyGTK2010], Qt with PyQt [RBC2010] or the official PySide [NOK2009] and Tkinter for Tcl/Tk [TKI2011].Furthermore there are also libraries to enhance Python's abilities to be used for scientific calculations, such as SciPy . It offers a wide range of functionality for “mathematics, science, and engineering” [SPY2011-1], including clustering, fourier transforms, linear algebra, image processing, optimization, statistic and signal processing [Oli07, 19-20].Similarly, Scientific Python is a collection of modules for scientific computing that includes (but is not limited to) automatic derivative calculation, a Fortran interface, 3D Vectors and tensors including quaternions, histogram generation and 3D visualisation modules [KH2007].RPy is a Python interface for the R Programming language [RPY2010] which allows easy access to statistical computing and graphics [RP].Python also has a range of libraries aimed at facilitating the generation of games and interactive environments. These include Pygame, which is a wrapper around the SDL library [PG], Python-Ogre, which allows the use of the open source Ogre3d engine [PO] through Python and PyOpenGL, which provides Python bindings for OpenGL [PGL].Targeting web applications a number of frameworks were developed. Django is a web application framework that focuses on rapid development and widespread automation and includes an object-relational mapper and an automatic admin interface [DP2011]. The Pylons Project is a project aiming to release a number of technologies related to web application frameworks, the current one being Pyramid [AC2011]. It aims to be simple and minimalistic and to make it easy for developers to write web applications [PP].Despite the fact that PHP is normally used as a server side scripting language, several libraries have been developed to facilitate PHP's use as a general purpose language, such

14

Page 15: Php vs Phyton

as libraries to allow the creation of Qt (through php-qt [PHPQT]) and GTK (through php-gtk [PHP2009]) GUIs using pure PHP. These libraries are a bit outdated though, as the latest GTK version supported by php-gtk is 2.12 [PHP2008] at the time of writing while the latest versions of the GTK are 2.24 and 3.0 [GTK+2011] and the php-qt project is still in its beta phase while it's latest release dates back to July, 2009 [PHPQT2009].Web development is still where PHP excels though, offering a number of frameworks and content management systems for this purpose. These include Joomla [OSM2011], Media Wiki [WMF2007], Drupal [DRP], TYPO3 and WordPress [WP], which were all written and can be extended through the use of the PHP language. Joomla is a free and open source CMS and application framework, whose official website claims that it powers 2.7% of the web [OSM2011]. WordPress is a publishing system and CMS aimed at blogging, but is suitable for general purpose use [WP]. The Media Wiki is a free and open source wiki that is most famously used for Wikipedia [WMF2007]. Drupal and TYPO3 are both content management and publishing systems released through the terms of the GPL [DRP][T3A2011].While Pythons selection of libraries is a mixture of many aspects of practical and theoretical computer science, offering solutions to many common tasks, PHP's libraries show a definite bias towards web-frameworks and content management systems. Attempts to extend PHP's reach to desktop applications through GUI libraries seem to have died down and become neglected, while the web-frameworks and content management systems are still under active use and development.

4. Conclusion

In conclusion it seems that both programming languages have a right to exist. Despite lacking standardisation and being limited in use beyond as a server-side scripting language, PHP offers a quick and easy means for Java or C# programmers to transition to PHP, if that should be necessary for a project. Furthermore, the vast amount of content management systems and web-frameworks written in PHP make it a good language of choice for programmers wanting to learn a web programming language. Its easy and lenient nature facilitate the writing of extensions for them. This can, however, be deceptive, as its weak typing system doesn't always produce errors when they would occur in stronger typed languages, thus creating an error source that might not always be discovered. The fact that PHP only has limited support for threading and that the garbage collector cannot be tweaked easily make it less suitable for long running applications, such as programs with GUIs or servers. It seems it is best placed to respond to requests on servers, in scripts that run for a short time and terminate, which also seems to be for which PHP is most commonly used.Python is a more versatile language, as it wasn't designed for any other specific purpose than to be versatile. It seems the inclusion of a formal language description into Pythons documentation nourished the creation of alternative implementations and the academic use of the language, as is evident through the creation of implementations such as PyPy, that take a very different approach to execution than the traditional CPython, as well as

15

Page 16: Php vs Phyton

the creation of a large number of scientific Python modules. Its versatility is evident through the number of different modules for various different purposes that were written for Python, as well as through the means parts of the language, such as class creation and destruction, the garbage collector or member access, can be modified to suit the needs of a given situation or problem. As such, it is hard to name usage scenarios for the Python language, as there is very little it cannot be used for.

The following table offers an overview of the previously discussed topics:

Python PHP

Language

Documentation Separate documentation for each release based on the previous release. The grammar is included in a BNF-like notation.

A single documentation for all versions. Major parts of the Zend Engines internals are missing. PHPs documentation lacks a formal grammar description.

Syntax Uses mandatory indentation for code structuring.

Uses C-like brackets for structuring code. Indentation is optional. Inconsistencies in case sensitivity.

Implementations CPython as the standard implementation written in C. Major alternative implementations include Jython written in Java and IronPython written in C#. Further, more specialized implementations exist.

The standard implementation for PHP comes in form of the Zend Engine 2, which was written in C. Probably due to the lack of a formal grammar description, no other complete implementations of PHP exist.

Garbage Collection

Reference counting with cycle detection. The garbage collector can be finely tweaked and analyzed at runtime.

Reference counting with cycle detection. The garbage collector can only be tweaked through altering the PHP source.

Type System Strongly typed, duck-typing Weakly typed

Extensibility Natively through a C API as well as through a system to call C code from within Python

Natively through a C API. This feature isn't well documented.

Embeddability Possibility to send Python code directly to the interpreter, as well

Undocumented feature. An embed SAPI is contained in the PHP

16

Page 17: Php vs Phyton

as through a C API source, but is experimental.

Paradigms

Object Orientation

Classes with private and public for encapsulation, multiple inheritance, fine tuning of access and class creation through special methods and meta classes. Exception handling is consistent for runtime errors.

Classes with private, protected and public for encapsulation, single inheritance, abstract classes and interfaces. Exception handling is inconsistent with some runtime errors that don't throw catchable exceptions.

Functional Anonymous functions through lambdas, restricted to contain only expressions. Functions can be passed by name.

Full support for anonymous functions including expressions and statements. Functions can be passed anonymously or by name.

Concurrency Available in CPython via multiprocessing, also via a fake threading interface. Implementations that support true threading are available.

Only available on Unix systems by means of multiprocessing.

Uses

Web Servers Specification for Web Server Gateway Interface supported by many different webservers.

Through SAPIs created for a range of webservers, most commonly Apache.

CLI Out of the box support with an interactive shell being the default action for the python executable.

CLI support is built by default when compiling PHP, it requires extra switches for an interactive shell.

Standalone Applications

Various GUI toolkits are available for GTK, Qt, Tcl/Tk.

GUI toolkits for PHP are available for Qt and GTK, but these appear to be outdated.

Libraries Large range of libraries for many different subjects, such as scientific calculations, statistics, graphics, games, web-frameworks.

PHP libraries are largely restricted to CMS and web-frameworks and tools for these.

17

Page 18: Php vs Phyton

5. References

[PSF2011-1] Python Software Foundation, Python v3.2 documentation, Language Reference, Introduction, 2011, <http://docs.python.org/py3k/reference/introduction.html> (13.06.2011)

[PSF2011-2] Python Software Foundation, Python v3.2 documentation, Language Reference, Lexical Analysis, Indentation, 2011<http://docs.python.org/py3k/reference/lexical_analysis.html#indentation> (13.06.2011)

[PSF2011-3] Python Software Foundation, Python v3.2 documentation, Language Reference, Lexical Analysis, Keywords, 2011<http://docs.python.org/py3k/reference/lexical_analysis.html#keywords> (13.06.2011)

[PSF2011-4] Python Software Foundation, Python v3.2 documentation, Extending and Embedding, Reference Counts, 2011<http://docs.python.org/py3k/extending/extending.html#reference-counts> (13.06.2011)

[PSF2011-5] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Python Runtime Services, Garbage Collector Interface, 2011<http://docs.python.org/py3k/library/gc.html> (13.06.2011)

[PSF2011-6] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Built-in Functions, 2011<http://docs.python.org/py3k/library/functions.html> (14.06.2011)

[PSF2011-7] Python Software Foundation, Python v3.2 documentation, Glossary, 2011<http://docs.python.org/py3k/glossary.html?highlight=duck#term-duck-typing> (14.06.2011)

[PSF2011-8] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Built-in Exceptions, 2011<http://docs.python.org/py3k/library/exceptions.html?highlight=type#TypeError> (14.06.2011)

[PSF2011-9] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Generic Operating System Services, ctypes, 2011<http://docs.python.org/py3k/library/ctypes.html > (14.06.2011)

[PSF2011-10] Python Software Foundation, Python v3.2 documentation, Extending and Embedding the Python Interpreter, 2011<http://docs.python.org/py3k/extending/extending.html> (14.06.2011)

[PSF2011-11] Python Software Foundation, Python v3.2 documentation, Extending and Embedding the Python Interpreter, Embedding Python in Another Application, 2011<http://docs.python.org/py3k/extending/embedding.html > (14.06.2011)

18

Page 19: Php vs Phyton

[PSF2011-12] Python Software Foundation, Python v3.2 documentation, The Python Tutorial, Classes, 2011<http://docs.python.org/py3k/tutorial/classes.html> (14.06.2011)

[PSF2011-13] Python Software Foundation, Python v3.2 documentation, Language Reference, Data Model, 2011<http://docs.python.org/py3k/reference/datamodel.html> (14.06.2011)

[PSF2011-14] Python Software Foundation, Python v3.2 documentation, Language Reference, Simple Statements, Assignment Statements, 2011<http://docs.python.org/py3k/reference/simple_stmts.html#assignment-statements> (14.06.2011)

[PSF2011-15] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Abstract Base Classes, 2011<http://docs.python.org/py3k/library/abc.html> (14.06.2011)

[PSF2011-16] Python Software Foundation, Python v3.2 documentation, Language Reference, Expressions, 2011<http://docs.python.org/py3k/reference/expressions.html#lambda> (14.06.2011)

[PSF2011-17] Python Software Foundation, Python v3.2 documentation, Python Frequently Asked Questions, Design and History FAQ, 2011<http://docs.python.org/py3k/faq/design.html#why-can-t-lambda-forms-contain-statements > (14.06.2011)

[PSF2011-18] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Optional Operating System Services, threading, 2011<http://docs.python.org/py3k/library/threading.html> (14.06.2011)

[PSF2011-19] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Optional Operating System Services, multiprocessing, 2011<http://docs.python.org/py3k/library/multiprocessing.html> (14.06.2011)

[PSF2011-20] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Internet Protocols and Support, 2011 <http://docs.python.org/py3k/library/wsgiref.html> (14.06.2011)

[PSF2011-21] Python Software Foundation, Python v3.2 documentation, The Python Tutorial, Using the Python Interpreter, 2011<http://docs.python.org/py3k/tutorial/interpreter.html> (14.06.2011)

[PSF2011-22] Python Software Foundation, Python v3.2 documentation, The Python Tutorial, An Informal Introduction to Python, 2011 <http://docs.python.org/py3k/tutorial/introduction.html> (14.06.2011)

[PSF2011-23] Python Software Foundation, Python v3.2 documentation, The Python Standard Library, Graphical User Interfaces with Tk, IDLE, 2011 <http://docs.python.org/py3k/library/idle.html> (14.06.2011)

[PSF2011-24] Python Software Foundation, Python v3.2 documentation, Python Frequently Asked Questions, 2011 <http://docs.python.org/py3k/faq/general > (14.06.2011)

[PSF2011-25] Python Software Foundation, Python v3.2 documentation, Language

19

Page 20: Php vs Phyton

Reference, Execution Model, 2011<http://docs.python.org/py3k/reference/executionmodel.html> (13.06.2011)

[PSF2011-26] Python Software Foundation, Python v3.2 documentation, The Python Tutorial, Errors and Exception, 2011<http://docs.python.org/py3k/tutorial/errors.html> (13.06.2011)

[PW2011] wiki.python.org, Python 2 or Python 3, 2011 <http://wiki.python.org/moin/Python2orPython3 > (14.06.2011)

[PSF2011-25] Python Software Foundation, Python v3.2 documentation, History and License, 2011 <http://docs.python.org/py3k/license.html#history-and-license > (14.06.2011)

[PSF2009] Python Software Foundation, Mission Statement of the Python Software Foundation, 2009 <http://www.python.org/psf/mission/> (14.06.2011)

[PE2003] Phillip J. Eby: Python Web Server Gateway Interface v1.0, Python Enhancement Proposal, 2003-2011, <http://www.python.org/dev/peps/pep-0333/> (14.06.2011)

[PE2010] Phillip J. Eby: Python Web Server Gateway Interface v1.0.1, Python Enhancement Proposal, 2010-2011,<http://www.python.org/dev/peps/pep-3333/> (14.06.2011)

[WSGI2010] wsgi.org, What is WSGI, 2010,<http://www.wsgi.org/wsgi/What_is_WSGI> (14.06.2011)

[WSGI2011] wsgi.org, Frameworks, 2011,<http://www.wsgi.org/wsgi/Frameworks> (14.06.2011)

[GD2011] Graham Dumpleton, What is mod_wsgi, 2011<http://code.google.com/p/modwsgi/> (14.06.2011)

[AS2011] The Apache Software Foundation, Apache Attic, Apache Quetzalcoatl,<http://attic.apache.org/projects/quetzalcoatl.html> (14.06.2011)

[AS2010] The Apache Software Foundation, Mod_Python, 2010<http://www.modpython.org/> (14.06.2011)

[SPY2011-1] SciPy.org, Homepage, 2011, <http://www.scipy.org/> (14.06.2011)

[SPY2011-2] SciPy.org, NumPy and SciPy Documentation, Reference, 2011 <http://docs.scipy.org/doc/scipy/reference/> (14.06.2011)

[KH2007] Konrad Hinsen, Scientific Python, Overview 2007 <http://dirac.cnrs-orleans.fr/plone/software/scientificpython/overview/> (14.06.2011)

[RPY2010] Rpy.sourceforge.net, About, 2010 <http://rpy.sourceforge.net/rpy.html> (14.06.2011)

[RP] The R Project for Statistical Computing, <http://www.r-project.org/> (14.06.2011)

[PG] PyGame, Wiki, About, <http://www.pygame.org/wiki/about> (14.06.2011)

[PO] Python-Ogre, Homepage,

20

Page 21: Php vs Phyton

<http://www.pythonogre.com/> (14.06.2011)[PGL] PyOpenGL, Homepage,

<http://pyopengl.sourceforge.net/> (14.06.2011)[DP2011] Django Software Foundation, Homepage, 2011,

<https://www.djangoproject.com/> (14.06.2011)[AC2011] Agendaless Consulting, Pylons Project FAQ, 2011,

<http://docs.pylonsproject.org/faq/pylonsproject.html> (14.06.2011)[PP] PylonsProject.org, About Pyramid,

<http://pylonsproject.org/projects/pyramid/about> (14.06.2011)[IP2011] Microsoft Corporation, Iron Python, Overview,

<http://ironpython.net/> (13.06.2011)[PP2011-1] The PyPy Project, PyPy, Features

<http://pypy.org/features.html> (13.06.2011)[PP2011-2] The PyPy Project PyPy v1.5 Documentation, Coding Guide, RPython,

2011 <http://pypy.readthedocs.org/en/latest/coding-guide.html#rpython> (13.06.2011)

[SL2011-1] Stackless, Homepage, <http://zope.stackless.com/> (13.06.2011)[PyGTK2010] The GNOME Project and PyGTK Team, PyGTK Homepage, 2010

<http://www.pygtk.org/> (14.06.2011)[RBC2010] Riverbank Computing Limited, PyQt Homepage, 2010

<http://www.riverbankcomputing.co.uk/software/pyqt/intro> (14.06.2011)

[NOK2009] Nokia Corporation, PySide FAQ, 2009, <http://developer.qt.nokia.com/wiki/PySide_FAQ> (14.06.2011)

[TKI2011] Tkinter Wiki, Front Page, 2011, <http://tkinter.unpythonic.net/wiki/FrontPage> (14.06.2011)

[PHP2011-1] The PHP Group, PHP Manual, About the manual, 2011 <http://www.php.net/manual/en/about.phpversions.php> (13.06.2011)

[PHP2011-2] The PHP Group, PHP Manual, PHP at the Core: A Hacker's Guide to the Zend Engine, 2011 <http://www.php.net/manual/en/internals2.php> (13.06.2011)

[PHP2011-3] The PHP Group, PHP Manual, User Note System, 2011 <http://www.php.net/manual/add-note.php> (13.06.2011)

[PHP2011-4] The PHP Group, PHP Manual, Escaping from HTML, 2011 <http://www.php.net/manual/en/language.basic-syntax.phpmode.php> (13.06.2011)

[PHP2011-5] The PHP Group, PHP Manual, Preface, 2011 <http://www.php.net/manual/en/preface.php> (13.06.2011)

[PHP2011-6] The PHP Group, PHP Manual, FAQ, General Information, 2011 <http://www.php.net/manual/en/faq.general.php > (13.06.2011)

[PHP2011-7] The PHP Group, PHP Manual, Function Reference, PHP Options/Info Functions, 2011 <http://www.php.net/manual/en/function.gc-collect-cycles.php> (13.06.2011)

21

Page 22: Php vs Phyton

[PHP2011-8] The PHP Group, PHP Manual, Features, Garbage Collection, 2011 <http://www..php.net/manual/en/features.gc.php > (13.06.2011)

[PHP2011-9] The PHP Group, PHP Manual, Language Reference, Types, Type Juggling, 2011 <http://www.php.net/manual/en/language.types.type-juggling.php > (13.06.2011)

[PHP2011-10] The PHP Group, PHP Manual, Language Reference, Types, Booleans, 2011 <http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting> (13.06.2011)

[PHP2011-11] The PHP Group, PHP Manual, Language Reference, Classes and Objects, Visibility, 2011 <http://www.php.net/manual/en/language.oop5.visibility.php > (14.06.2011)

[PHP2011-12] The PHP Group, PHP Manual, Language Reference, Classes and Objects, Properties, 2011 <http://www.php.net/manual/en/language.oop5.properties.php> (14.06.2011)

[PHP2011-13] The PHP Group, PHP Manual, Language Reference, Classes and Objects, Overloading, 2011 <http://www.php.net/manual/en/language.oop5.overloading.php > (14.06.2011)

[PHP2011-14] The PHP Group, PHP Manual, Language Reference, Classes and Objects, Inheritance, 2011 <http://www.php.net/manual/en/language.oop5.inheritance.php> (14.06.2011)

[PHP2011-15] The PHP Group, PHP Manual, Appendices, Classes and Objects, extends, 2011 <http://www.php.net/manual/en/keyword.extends.php> (14.06.2011)

[PHP2011-16] The PHP Group, PHP Manual, Language Reference, Classes and Objects, Class Abstraction, 2011 <http://www.php.net/manual/en/language.oop5.abstract.php> (14.06.2011)

[PHP2011-17] The PHP Group, PHP Manual, Language Reference, Classes and Objects, Object Interfaces, 2011 <http://www.php.net/manual/en/language.oop5.interfaces.php> (14.06.2011)

[PHP2011-18] The PHP Group, PHP Manual, Language Reference, Functions, Anonymous Functions, 2011 <http://www.php.net/manual/en/language.oop5.interfaces.php> (14.06.2011)

[PHP2011-19] The PHP Group, PHP Manual, Function Reference, Process Control Extensions, PCNTL, Installation, 2011 <http://www.php.net/manual/en/pcntl.installation.php> (14.06.2011)

[PHP2011-20] The PHP Group, PHP Manual, PHP at the Core: A Hacker's Guide to

22

Page 23: Php vs Phyton

the Zend Engine, Extension Globals, 2011 <http://www.php.net/manual/en/internals2.structure.globals.php> (14.06.2011)

[PHP2011-21] PHP Source Code, Version 5.3.6, php-5.3.6.tar.gz, php-5.3.6/sapi/, 2011, accessed via <http://www.php.net/downloads.php> (14.06.2011)

[PHP2011-22] The PHP Group, PHP Manual, Installation and Configuration, Installation on Unix Systems, Apache 2.x on Unix systems, 2011<http://www.php.net/manual/en/install.unix.apache2.php> (14.06.2011)

[PHP2011-23] The PHP Group, PHP Manual, Features, Command Line Usage, Introduction, 2011<http://www.php.net/manual/en/features.commandline.introduction.php> (14.06.2011)

[PHP2011-24] The PHP Group, PHP Manual, Features, Command Line Usage, Interactive Shell, 2011<http://www.php.net/manual/en/features.commandline.interactive.php> (14.06.2011)

[PHP2011-25] The PHP Group, PHP Manual, Features, Command Line Usage, Usage, 2011,<http://www.php.net/manual/en/features.commandline.usage.php> (14.06.2011)

[PHP2011-26] The PHP Group, PHP Manual, Appendices, History of PHP and related projects, History of PHP, 2011<http://www.php.net/manual/en/history.php.php> (14.06.2011)

[PHP2011-27] The PHP Group, PHP Manual, Getting Started, Introduction, What can PHP do?, 2011<http://www.php.net/manual/en/intro-whatcando.php > (14.06.2011)

[PHP2011-28] The PHP Group, PHP Manual, Language Reference, Exceptions, 2011<http://php.net/manual/en/language.exceptions.php> (13.08.2011)

[PHP2009] The PHP Group, PHP GTK, FAQ, 2009<http://gtk.php.net/faq.php> (14.06.2011)

[PHP2008] The PHP Group, PHP GTK, Change Log, 2008,<http://gtk.php.net/changelog.php> (14.06.2011)

[GTK+2011] The GTK+ Team, Download for GNU/Linux and Unix, 2011, <http://www.gtk.org/download/linux.php> (14.06.2011)

[PHPQT2009] tm245, PHP-Qt Source Forge Page, 2009, <http://sourceforge.net/projects/php-qt/> (14.06.2011)

[PHPQT] tm245, kniolet, PHP-Qt berliOS Page, <https://developer.berlios.de/projects/php-qt/> (14.06.2011)

[EK2011] Edin Kadribasic, PHP Source Code, Version 5.3.6, php-5.3.6.tar.gz, embed SAPI, Experimental notice, php-5.3.6/sapi/embed/ EXPERIMENTAL, 2011, accessed via <http://www.php.net/downloads.php> (14.06.2011)

[PZ2008-1] IBM Corporation, Project Zero, FAQ, 2008,

23

Page 24: Php vs Phyton

<http://www.projectzero.org/about/zerofaq.php> (13.06.2011)[PH2011-1] Phalanger, Homepage, 2011,

<http://phalanger.codeplex.com/> (13.06.2011)[HH2011-1] Facebook, HipHop, 2010,

<https://github.com/facebook/hiphop-php/wiki/> (13.06.2011)[OSM2011] Open Source Matter Inc, Joomla, About Joomla, 2011,

<http://www.joomla.org/about-joomla.html> (14.06.2011)[WP] WordPress.org, WordPress, About WordPress,

<http://wordpress.org/about/> (14.06.2011)[WMF2007] Wikimedia Foundation, MediaWiki, 2007,

<http://www.mediawiki.org/wiki/Main_Page> (14.06.2011)[DRP] Drupal.org, About Drupal,

<http://drupal.org/about> (14.06.2011)[T3A2011] TYPO3 Association, What is TYPO3?,

<http://typo3.com/About.1231.0.html> (14.06.2011)[AF2011] Apache Friends, Kai Seidler, XAMPP

<http://www.apachefriends.org/en/xampp.html> (12.08.2011)[JWBSN2010] Josh Juneau, Frank Wierzbicki, Jim Baker, Leo Soto, Victor Ng: The

Definitive Guide to Jython: Python for the Java Platform, Springer-Verlag New York,USA, 2010, ISBN: 978-1-4302-2527-0, accessed via <http://www.jython.org/jythonbook/en/1.0/index.html> (13.06.2011)

[Dop10] F. Dopatka: PHP Endlich objektorientiert OO- und UML-Praxisbuch: vom Anfänger zum Fortgeschrittenen; Software & Support Verlag GmbH; Frankfurt; 2010; ISBN 978-3-86802-039-7

[Oli07] T.E. Oliphant: Python for Scientific Computing; in: Computing in Science and Engineering; Volume 9, Issue 3; VDE Verlag Conference Proceedings; 18.06.2007; ISSN 1521-9615; p 10-20; accessed via <http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4160250> (12.08.2011)

[Cho08] Nikolaj Cholakov: On some drawbacks of the PHP platform; in: CompSysTech '08 Proceedings of the 9th International Conference on Computer Systems and Technologies and Workshop for PhD Students in Computing; ACM; New York, USA; 2008; ISBN 978-954-9641-52-3; doi 10.1145/1500879.1500894; accessed via <http://portal.acm.org/citation.cfm?id=1500879.1500894> (12.08.2011)

24