Professional Documents
Culture Documents
PHP was conceived sometime in the fall of 1994 by Rasmus Lerdorf. Early non-
released versions were used on his home page to keep track of who was looking at his
online resume. The first version used by others was available sometime in early 1995
and was known as the Personal Home Page Tools. It consisted of a very simplistic
parser engine that only understood a few special macros and a number of utilities that
were in common use on home pages back then. A guestbook, a counter and some
other stuff. The parser was rewritten in mid-1995 and named PHP/FI Version 2. The
FI came from another package Rasmus had written which interpreted html form data.
He combined the Personal Home Page tools scripts with the Form Interpreter and
added mSQL support and PHP/FI was born. PHP/FI grew at an amazing pace and
people started contributing code to it.
It is difficult to give any hard statistics, but it is estimated that by late 1996 PHP/FI
was in use on at least 15,000 web sites around the world. By mid-1997 this number
had grown to over 50,000. Mid-1997 also saw a change in the development of PHP. It
changed from being Rasmus' own pet project that a handful of people had contributed
to, to being a much more organized team effort. The parser was rewritten from scratch
by Zeev Suraski and Andi Gutmans and this new parser formed the basis for PHP
Version 3. A lot of the utility code from PHP/FI was ported over to PHP3 and a lot of
it was completely rewritten.
Also as of this writing, work is underway on the next generation of PHP, which will
utilize the powerful Zend scripting engine to deliver higher performance, and will also
support running under webservers other than Apache as a native server module.
Php Version
1. PHP Version 1.0
As mentioned before, PHP development started way back in 1994 and was developed by
Rasmus Lerdorf. He used C as a scripting language and wrote several Common Gateway
Interface programs.
He originally used them to maintain his personal homepage. He later extended these
code specs to work with web forms and databases. This upgraded implementation was
called Personal Home Page or Forms interpreted.
This initial version of PHP already had several basic functionalities. It has form handling
capabilities, Perl like variables and the ability to work with HTML. The syntax was also
similar to; however, it was simpler but inconsistent.
In 1997, Zeev Suraski and Andi Gutmans rewrote the internal PHP parser and formed the
basic structure for PHP 3. The official launch of PHP 3 was done in June 1998 once the
public testing was completed.
Later, Suraski and Gutmans started with re-write the core PHP and produced the Zend
engine in 1999. This led to the foundation of Zend Technologies in Israel.
PHP 7 is based on phpng which stands for PHP next Generation. PHP Next Generation
was an initiative by developers to overcome the high-performance constraints of
previous PHP versions. The phpng branch served as the base branch for PHP version 7.0.
PHP 7 did provide several optimizations and performance improvements. It also included
an in-build caching mechanism for better performance. But these could never match the
performance a JIT compiler could provide.
Though PHP can continue to evolve it also has certain drawbacks due to which it may
not appeal to all developers. PHP is an open-source code language, which means
anybody can access its core ode base and identify shortcomings to take advantage of.
As a result of this weakness, the probability of PHP websites to be hacked is higher than
those built-in other languages. Since PHP is not very modular, it is not a favorable
language for developing large applications. Also, PHP data types may surprise new
programmers. For instance, the string “1000” is the same as “1e3” as they both cast to
float type.
PHP Features
Performance:
PHP script is executed much faster than those scripts which are written in other languages such as JSP and
ASP. PHP uses its own memory, so the server workload and loading time is automatically reduced, which
results in faster processing speed and better performance.
Open Source:
PHP source code and software are freely available on the web. You can develop all the versions of PHP
according to your requirement without paying any cost. All its components are free to download and use.
PHP has easily understandable syntax. Programmers are comfortable coding with it.
Embedded:
PHP code can be easily embedded within HTML tags and script.
Platform Independent:
PHP is available for WINDOWS, MAC, LINUX & UNIX operating system. A PHP application developed in
one OS can be easily executed in other OS also.
Database Support:
PHP supports all the leading databases such as MySQL, SQLite, ODBC, etc.
Error Reporting -
PHP has predefined error reporting constants to generate an error notice or warning at runtime. E.g.,
E_ERROR, E_WARNING, E_STRICT, E_PARSE.
PHP allows us to use a variable without declaring its datatype. It will be taken automatically at the time of
execution based on the type of data it contains on its value.
PHP is compatible with almost all local servers used today like Apache, Netscape, Microsoft IIS, etc.
Security:
PHP is a secure language to develop the website. It consists of multiple layers of security to prevent
threads and malicious attacks.
Control:
Different programming languages require long script or code, whereas PHP can do the same work in a
few lines of code. It has maximum control over the websites like you can make changes easily whenever
you want.
Advantages of PHP
1. Open Source
PHP is open-source and free of cost, which helps developers to install it quickly and readily available for use. There are a lot of PHP frameworks and
developer can choose any of the frameworks to work. All the features and tools will be provided to the developer for that framework easily. As it is
open-source, it makes the system ready with PHP in quick time and makes the web development faster with the help of providing the tools and other
features easily.
2. Platform Independent
PHP is mainly supported by all the operating systems like Windows, Unix, Linux etc. The PHP based developed web applications can be easily run on
any platform. It can be integrated with other programming language and database easily and there is no requirement of re-development. It helps in
functions of PHP can easily learn and understood. The one who knows any programming language can easily work on PHP. It is simple to learn, as its
learning curve is not large. The syntax is simple and flexible to use.
4. Database
PHP is easily connected with the database and make the connection securely with databases. It has a built-in module that is used to connect to the
database easily. There are many web applications, which require strong programming language with a good database management system. PHP and
its database connection solve the purpose for development of web applications. It reduces the time to connect to a database management system as
5. Fast
PHP is known as the fastest Programming language as compared to another. PHP applications can be easily loaded over the slow Internet and data
speed. Other applications take a lot of time to connect the database and fetch the data after executing certain queries to the database. PHP does not
face this problem and it loads the website very easily and fast. The fast speed of PHP provides the developer with an edge to develop the web
6. Maintenance
PHP framework is mainly used to make the web application development easier and maintain the code automatically. The model view controller
architecture in PHP framework helps the code to be easily maintained and used. The MVC architecture helps the separation of a file for different
module separately.
7. Support
This advantage of PHP has great online support and community, which helps the new developers to help in writing the code and developing the web
applications. The documentation provided at the official site helps in using the different features of PHP and its framework. The latest updates are
released timely by the PHP to make it better for the developer to develop the web-based applications.
8. Testing
PHP based web applications can be easily tested. PHP unit uses to perform the unit testing quickly and easily. It also helps the programmers to write
test cases and perform the testing smoothly. For PHP based web applications, the developers do not need to write the additional code. PHP
9. Security
PHP frameworks built-in feature and tools make it easier to protect the web applications from the outer attacks and security threats. The security
threats can be like SQL injection, data tampering, and forgery etc. To protect from these security threats, developers used PHP frameworks for
10. Stable
PHP is also stable as compared to other programming languages. It has been in existence for a long time. The developers have worked on PHP to make
it easy for the programmers to work on developing the PHP web-based applications. They have fixed the issues and bugs over the period of time for
Variables can store data of different types, and different data types can do different things.
String
Integer
Float (floating point numbers - also called double)
Boolean
Array
Object
NULL
Resource
PHP Operators
1. Arithmetic Operators
2. Assignment Operators
3. Bitwise Operators
4. Comparison Operators
5. Incrementing/Decrementing Operators
6. Logical Operators
7. String Operators
8. Array Operators
9. Type Operators
10. Execution Operators
11. Error Control Operators