Sie sind auf Seite 1von 6

Roll no 14211a1269 DT:18-03-2017

K DILEEP REDDY

Advantages and disadvantages of


Php version 3

PHP :

PHP (PHP: Hypertext Preprocessor) is a scripting language that


helps people make web pages more interactive by allowing them to do
more things.
A website programmed with PHP can have pages that are password
protected. A website with no programming cannot do this without other
complex things. Standard PHP file extensions are: .php .php3 or .phtml,
but a web server can be set up to use any extension.
Its structure was influenced by many languages like C, Perl, Java, C++,
and even Python. It is considered to be free software by the Free
Software Foundation

PHP is a server-side scripting language designed primarily for web


development but also used as a general-purpose programming
language. Originally created by Rasmus Lerdorf in 1994. PHP code may
be embedded into HTML or HTML5 code, or it can be used in
combination with various web template systems, web content
management systems and web frameworks. PHP code is usually
processed by a PHP interpreter implemented as a module in the web
server or as a Common Gateway Interface (CGI) executable. The web
server combines the results of the interpreted and executed PHP code,
which may be any type of data, including images, with the generated
web page. PHP code may also be executed with a command-line
interface (CLI) and can be used to implement standalone graphical
applications.

Zeev Suraski and Andi Gutmans rewrote the parser in 1997 and
formed the base of PHP 3, changing the language's name to
the recursive acronym PHP: Hypertext Preprocessor. Afterwards, public
testing of PHP 3 began, and the official launch came in June 1998.
Roll no 14211a1269 DT:18-03-2017
K DILEEP REDDY

The standard PHP interpreter, powered by the Zend Engine, is free


software released under the PHP License. PHP has been widely ported
and can be deployed on most web servers on almost every operating
system and platform, free of charge.

The PHP language evolved without a written formal specification or


standard until 2014. PHP development began in 1995 when Rasmus
Lerdorf wrote several Common Gateway Interface (CGI) programs in
C which he used to maintain his personal homepage. He extended
them to work with web forms and to communicate with databases, and
called this implementation "Personal Home Page/Forms Interpreter" or
PHP/FI.

PHP/FI could help to build simple, dynamic web applications. To


accelerate bug reporting and to improve the code, Lerdorf initially
announced the release of PHP/FI as "Personal Home Page Tools (PHP
Tools) version 1.0" on the Usenet discussion
group comp.infosystems.www.authoring.cgi on June 8, 1995. This
release already had the basic functionality that PHP has as of 2013. This
included Perl-like variables, form handling, and the ability to embed
HTML. The syntax resembled that of Perl but was simpler, more limited
and less consistent.

Basic language constructs


PHP generally follows c syntax, with exceptions and enhancements for
its main use in web development, which makes heavy use of string
manipulation. PHP variables must be prefixed by "$". This allows PHP to
perform string interpolation in double quoted strings, where backslash is
supported as an escape character. No escaping or interpolation is done
on strings delimited by single quotes. PHP also supports a C-
like printf function. Code can be modularized into functions defined with
keyword function . PHP supports an optional object oriented coding
style, with classes denoted by the class keyword. Functions defined
inside classes are sometimes called methods. Control
structures include: if, while, do/while, for, foreach, and switch.
Statements are terminated by a semicolon, not line endings
Delimiters
Roll no 14211a1269 DT:18-03-2017
K DILEEP REDDY

The PHP processor only parses code within its delimiters. Anything
outside its delimiters is sent directly to the output and not parsed by
PHP. The only open/close delimiters allowed by PSR-1 are " <?php "
and " ?> " or <?= and ?> . In files containing only PHP, the closing tag
should be omitted.
The purpose of the delimiting tags is to separate PHP code from non-
PHP data (mainly HTML). Although rare in practice, PHP will execute
code embedded in any file passed to its interpreter, including binary
files such as PDF or JPEG files, or in server log files. Everything outside
the delimiters is ignored by the PHP parser and is passed through as
output.
These recommended delimiters create correctly formed XHTML and
other XML documents. This may be helpful if the source code
documents ever need to be processed in other ways during the life of
the software.
If proper XML validation is not an issue, and a file contains only PHP
code, it is preferable to omit the PHP closing ( ?> ) tag at the end of the
file.

Advantages of php:

1: Simple and easy to learn

PHP scripting is definitely one of the easiest, if not the easiest scripting
language to learn and grasp for developers. This is partially due to the
similarities PHP syntax has with C and Java. Even if the only knowledge
of development that you have is with HTML, picking up PHP is still fairly
easy. For developers just starting out, PHP is often the first scripting
language they learn because it?s clear and easy to understand.

2: Support

The last thing you want as a developer is to be ?stuck? with a coding


issue and not have anywhere to go for help or answers. Since PHP is so
popular and widely used, finding help or documentation for PHP online is
extremely easy. The best part is the support is free through forums,
PDFs, blogs, and social media. The fact that it?s open source also
contributes to the large support community of PHP and LAMP (Linux,
Roll no 14211a1269 DT:18-03-2017
K DILEEP REDDY

Apache, MySQL, and PHP) in general. PHP has the largest user base of
any scripting language.

3: Freedom

When comparing PHP to a language such as ASPX, the level of


freedom you get is far superior. As mentioned in reason #2, PHP is open
source. You can use any text editor in order to code PHP such as
Notebook++, jEdit, Emacs, Bluefish, or even just Notepad if you feel
inclined. If you want to develop applications with ASPX, you?re going to
be limited to Microsoft Visual Studio. Restrictions are never a good thing,
especially with coding.

PHP also isn?t OS specific. You can run PHP on:

– Linux

– Mac OSX

– Windows

– UNIX

4: Free

There are no costs associated with using PHP, including updates.


Keeping costs down is a goal of any business and developers as well.
So the fact that you can code programs with PHP for free is a huge
benefit that you won?t get with JPS, ASP, or other scripting languages
that require paid hosting. There are no licenses, restrictions, or royalty
fees involved at all. PHP is 100% free for anyone to use.

5: Integration

PHP is used for so many web applications and actually powers over
30% of the web. Systems such as MongoDB, Memcache, and Pusher all
integrate with PHP. Almost any industry you can think of uses PHP
applications in some fashion including banks, hospitals, government,
and large corporations.
Roll no 14211a1269 DT:18-03-2017
K DILEEP REDDY

6: Frameworks

Almost every benefit of PHP seems to go back to the fact that the
community is so large. The number of PHP frameworks available is even

further proof of how strong the PHP community is. Whether you?re
looking for database access libraries, session management, or code

reuse, you will have no problem finding PHP frameworks to give you a
helping hand. Some popular PHP frameworks include:

– Aiki

– Symfony

– Zend

– Silex

– Slim

7: Easier to fix problems

When it comes to web application development, you?re bound to run


into issues and come across the occasional ?fail?. But the benefit you
get with PHP is that problems aren?t as difficult to find and fix as they
are with other languages. This is because with each request, PHP
cleans up and starts over. So an issue with one request will not
necessarily disrupt another.

8: Scalability

In the world of IT, the word scalability is like gold. Whether you?re
dealing with databases, hosting, or in this case, programming, scalability
is never a bad thing. Due to the way PHP is built, you can easily
increase your cluster size by adding more servers as your projects grow.

9: Object Oriented

PHP actually has the ability to call Java and Windows COM objects. In
addition to this, you can create custom classes. Other classes can
Roll no 14211a1269 DT:18-03-2017
K DILEEP REDDY

actually borrow from those custom classes as well which extends the
capabilities of PHP even further.

10: Speed

Since PHP does not use a lot of a system?s resources in order to run, it
operates much faster than other scripting languages. Hosting PHP is
also very easy and lot of hosts provide support for PHP. Even when
used with other software, PHP still retains speed without slowing down
other processes. Being that PHP is a mature language, it is also fairly
stable because all the kinks have been worked out over the years.

DISADVANTAGES OF PHP:

Security :
Since it is open sourced, so all people can see the source code, if there
are bugs in the source code, it can be used by people to explore the
weakness of PHP

Not suitable for large applications:

Hard to maintain since it is not very modular.

Weak type:

Implicit conversion may surprise unwary programmers and lead to


unexpected bugs. For example, the strings “1000” and “1e3” compare
equal because they are implicitly cast to floating point numbers.

Das könnte Ihnen auch gefallen