0% found this document useful (0 votes)
12 views8 pages

Introduction To PHP 19-1-24

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 8

Introduction to PHP as a Programming Language

PHP is a programming language that basically used for developing web-based


software applications.
or
PHP is an open source, server-side, HTML-embedded web-scripting language
used for developing web-based software applications. It is used to manage
dynamic content, databases, session tracking, even to build entire e-commerce
sites.

/* dynamic content – content generated or altered in real time based on user


behaviour, location or other factors.
Session tracking – mechanism used to maintain the state about a series of
requests from the same user over some period of time */

It was originally created by a Danish-Canadian programmer Rasmus Lerdorf in


1993 and released in 1995. He is often referred to as the "Father of PHP." The
PHP reference implementation is now produced by the PHP Group.
PHP was originally named as Personal Home Page, but now it stands for
Hypertext Preprocessor.

 PHP files can contain text, HTML, CSS, JavaScript, and PHP code
 PHP code is executed on the server, and the result is returned to the
browser as plain HTML
 PHP files have extension ".php"

Five important characteristics make PHP's practical nature possible:


 Simplicity
 Efficiency
 Security
 Flexibility
 Familiarity
Common uses of PHP
 PHP can perform system functions, i.e. from files on a system it can
create, open, read, write, and close them.
 PHP can handle forms, i.e. gather data from files, save data to a file, thru
email we can send data, return data to the user.
 We can add, delete, modify elements within the database thru PHP.
 Access cookies variables and set cookies.
 Using PHP, we can restrict users to access some pages of our website.
 It can be used to encrypt data

Advantages of PHP

It brings many advantages to web development:

 Simple: PHP is quite easy to learn and use. It has a vast set of tutorials,
resources, and other insights that anyone can use to learn this language
effortlessly.
 Performance: PHP websites typically run very fast (rather than JSP,
ASP.NET etc.). It runs efficiently on the server side.
 Stable: PHP is stable since it has been in existence for a long time.
 Open-source: PHP is open source and free to use. It means that
developers don’t have to pay a license fee to use PHP to develop
software products. An open source programming language is thus one in
which the source code to the language's compiler or interpreter is
accessible for viewing, modifying and redistributing to the world.
Download it from the official PHP resource: www.php.net
 Community support: PHP has an active online community that helps you
whenever you face an issue. PHP Extension Community Library
(http://pecl.php.net/), which contains hundreds of ready-made widgets
and extensions that developers can use to painlessly add new
functionality to PHP. Using these widgets is often a more time- and cost-
efficient alternative to rolling your own code.
 Flexible: Since It is a dynamically typed language, there are no hard
rules on how to build features using it.
 Third-Party Application Support: It supports all the widely used
databases, including MySQL, ODBC, SQLite etc.
 Secured: It provides us a secure platform for developing websites as it
has multiple security levels.
 Portability: PHP runs on various platforms (Windows, Linux, Unix, Mac
OS X, etc.)
 Compatibility: It is compatible with almost all servers used today
(Apache, IIS, etc.)
 Supports many Protocols: PHP supports a large number of major
protocols such as POP3, IMAP, and LDAP.
 Extensible: Extensible architecture of PHP enables developers to easily
add support for new technologies to the language through modular
extensions.

Applications of PHP
 Server-side web development: It is a development where the
program runs on server dealing with the generation of content of
web page.
 Content Management Systems (CMS): It is a framework already
designed by other programmers and coders on which you can either
contribute your knowledge and skills, or just use those coders’ skills
to design your own website or blog
 E-commerce websites: E-commerce, or electronic commerce, refers
to the buying and selling of goods and services over the internet.
 Database-driven applications: It is a software application that relies
on a database to store, manage, and retrieve data. It utilizes a
database management system (DBMS) to organize and manipulate
data, enabling efficient data storage, retrieval, and management.
 Web APIs: It is an API as the name suggests, it can be accessed over
the web using the HTTP protocol. It is a framework that helps you to
create and develop HTTP based services.

History

Ve Relea
Supporte
rsi se Notes
d until
on date
8
Officially called "Personal Home Page Tools (PHP Tools)".
1.0 June
This is the first use of the name "PHP".
1995

1 Officially called "PHP/FI 2.0". This is the first release that


Nove could actually be characterised as PHP, being a standalone
2.0
mber language with many features that have endured to the
1997 present day.

6 20 Development moves from one person to multiple


3.0 June October developers. Zeev Suraski and Andi Gutmans rewritten the
1998 2000 base for this version.

22
23 June Added more advanced two-stage parse/execute tag-
4.0 May
2001 parsing system called the Zend engine.
2000

10
12
Dece Introduced "superglobals" ( $_GET , $_POST , $_SESSION ,
4.1 March
mber etc.)
2002
2001[

Disabled register_globals by default. Data received over


22 6
4.2 April Septemb the network is not inserted directly into
2002 er 2002 the global namespace anymore, closing possible security
holes in applications.

27
31
Dece Introduced the command-line interface (CLI), to
4.3 March
mber supplement the CGI.
2005
2002

4.4 11 7 August Fixed a memory corruption bug, which required breaking


July binary compatibility with extensions compiled against PHP
2008
2005 version 4.3.x.

13 5
5.0 July Septemb Zend Engine II with a new object model.
2004 er 2005

24 Performance improvements with the introduction of


24
Nove compiler variables in re-engineered PHP Engine. Added
5.1 August
mber PHP Data Objects (PDO) as a consistent interface for
2006
2005 accessing databases.

2
6
Nove Enabled the filter extension by default.
5.2 January
mber Native JSON support.
2011
2006

Namespace support; late static bindings, jump label


(limited goto), anonymous functions, closures, PHP
archives (phar), garbage collection for circular references,
30 14 improved Windows support, sqlite3, mysqlnd as a
5.3 June August replacement for libmysql as the underlying library for the
2009 2014 extensions that work with MySQL, fileinfo as a
replacement for mime_magic for better MIME support,
the Internationalization extension, and deprecation of
ereg extension.

Trait support, short array syntax support. Removed


1 items: register_globals , safe_mode , allow_call_time_pas
3
Marc s_reference , session_register() , session_unregister() and
5.4 Septemb
h session_is_registered() . Built-in web server. Several
er 2015
2012 improvements to existing features, performance and
reduced memory requirements.
20 Support for generators, finally blocks for exceptions
10 July
5.5 June handling, OpCache (based on Zend Optimizer+) bundled in
2016
2013 official distribution.

Constant scalar expressions, variadic functions, argument


28 unpacking, new exponentiation operator, extensions of
31
Augus the use statement for functions and constants,
5.6 Decemb
t
er 2018 new phpdbg debugger as a SAPI module, and other
2014
smaller improvements.

Not
Abandoned version of PHP that planned to include native
6.x releas —
Unicode support.
ed

Zend Engine 3 (performance improvements and 64-bit


integer support on Windows), uniform variable syntax,
AST-based compilation process,
added Closure::call() , bitwise shift consistency across
platforms, ?? (null coalesce) operator, Unicode code
3 point escape syntax, return type declarations, scalar type
10
Dece (integer, float, string and boolean) declarations,
7.0 January
mber <=> "spaceship" three-way
2019
2015 comparison operator, generator delegation, anonymous
classes, simpler and more consistently
available CSPRNG API, replacement of many remaining
internal PHP "errors" with the more modern exceptions,
and shorthand syntax for importing multiple items from a
namespace.

1
1
Dece iterable type, nullable types, void return type, class
7.1 Decemb
mber constant visibility modifiers, short list syntax, ulti-catch
er 2019
2016
30
30 Object parameter and return type declaration, Libsodium
Nove
7.2 Novemb extension, abstract method overriding, parameter type
mber
er 2020 widening
2017

6
6 Flexible Heredoc and Nowdoc syntax, support for
Dece
7.3 Decemb reference assignment and array deconstruction with
mber
er 2021 list(), PCRE2 support, hrtime() function
2018

Typed properties 2.0, prelooperading, null-coalescing


assignment ator, improve open
28
28 ssl_random_pseudo_bytes, WeakReferences,
Nove
7.4 Novemb FFI – foreign function interface, always available hash
mber
er 2022 extension, password hash registry, multibyte string
2019
splitting, reflection for references, unbundle
ext/wddx, new custom object serialization mechanism

Just-In-Time (JIT) compilation, arrays starting with a


negative index, stricter/saner language semantics
(validation for abstract trait methods), saner string to
number comparisons, saner numeric strings, TypeError on
invalid arithmetic/bitwise operators, reclassification of
26
26 various engine errors, consistent type errors for internal
Nove
8.0 Novemb functions, fatal error for incompatible method signatures),
mber
er 2023 locale-independent float to string conversion, variable
2020
syntax tweaks, attributes, named arguments, match
expression, constructor property promotion, union
types, mixed type, static return type, nullsafe
operator, non-capturing catches, throw expression, JSON
extension is always available

25 Explicit octal integer literal notation, enumerations, read


25
Nove only properties, first-class callable syntax, new in
8.1 Novemb
mber initializers, pure intersection types, never return type, final
er 2024
2021 class constraints, fibers
8
8 Read only classes, null, false, and true as stand-alone
Dece
8.2 Decemb types, locale-independent case conversion, sjunctive
mber
er 2025 normal form types, constants in trait
2022

23 Typed class constants, Dynamic class constant fetch, New


23
Nove `#[\Override]` attribute, Deep-cloning of readonly
8.3 Novemb
mber properties, New `json_validate()` function, Randomizer
er 2026
2023 additions, Command line linter sup

You might also like