0% found this document useful (0 votes)
43 views

De L'esprit À La Machine L'approche Professo-Académique

The document discusses the history and features of PHP. It notes that PHP was running on over 254 million websites in 2007 and is the 6th most popular programming language. Key features discussed include generators, the finally keyword, improved password hashing, dereferencing arrays and strings, and improved GD and class name resolution. Deprecated features such as ext/mysql and preg_replace()/e are also listed.

Uploaded by

Abdelahad Satour
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

De L'esprit À La Machine L'approche Professo-Académique

The document discusses the history and features of PHP. It notes that PHP was running on over 254 million websites in 2007 and is the 6th most popular programming language. Key features discussed include generators, the finally keyword, improved password hashing, dereferencing arrays and strings, and improved GD and class name resolution. Deprecated features such as ext/mysql and preg_replace()/e are also listed.

Uploaded by

Abdelahad Satour
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

De l'esprit à la machine

L'approche Professo-Académique

ZCE

Séances
Introduction Générale
 Welcome to the world of PHP, one of the Web's most
popular programming languages. According to Netcraft
(www.netcraft.com), PHP was running on more than 254
million Web sites in July 2007
(http://www.php.net/usage.php). At the time of writing, it's
the sixth most popular programming language in the world
according to TIOBE
(http://www.tiobe.com/index.php/content/paperinfo/tpci/
), beaten only by Java, C, Objective-C, C++ and C#
 PHP stands for PHP: Hypertext Preprocessor, which gives
you a good idea of its core purpose: to process information
and produce hypertext (HTML) as a result. (Developers love
recursive acronyms, and PHP: Hypertext Preprocessor is a
good example of one.)
 One of the best things about PHP is the large number of
Internet service providers (ISPs) and Web hosting
companies that support it. Today hundreds of thousands of
developers are using PHP, and it's not surprising that there
are so many, considering that several million sites are
reported to have PHP installed.

Another great feature of PHP is that it's cross-platform —


you can run PHP programs on Windows, Linux, FreeBSD,
Mac OS X, and Solaris, among others.

What's more, the PHP engine can integrate with all common
Web servers, including Apache, Internet Information Server
(IIS), Zeus, and lighttpd.
 Although PHP only started gaining popularity with Web
developers around 1998, it was created by Rasmus Lerdorf
way back in 1994. PHP started out as a set of simple tools
coded in the C language to replace the Perl scripts that
Rasmus was using on his personal home page (hence the
original meaning of the "PHP" acronym). He released PHP to
the general public in 1995, and called it PHP version 2.

In 1997, two more developers, Zeev Suraski and Andi


Gutmans, rewrote most of PHP and, along with Rasmus,
released PHP version 3.0 in June 1998. By the end of that
year, PHP had already amassed tens of thousands of
developers, and was being used on hundreds of thousands
of Web sites.
 For the next version of PHP, Zeev and Andi set about
rewriting the PHP core yet again, calling it the "Zend
Engine" (basing the name "Zend" on their two names). The
new version, PHP 4, was launched in May 2000. This
version further improved on PHP 3, and included session
handling features, output buffering, a richer core language,
and support for a wider variety of Web server platforms.

Although PHP 4 was a marked improvement over version 3,


it still suffered from a relatively poor object-oriented
programming (OOP) implementation. PHP 5, released in July
2004, addressed this issue, with private and protected
class members; final, private, protected, and static
methods; abstract classes; interfaces; and a standardized
constructor/destructor syntax.
 Generators

Generators are supposed to be the greatest features added


to PHP 5.5. Generators permit to create custom functions
that retain the state between runs. A generator provides a
simple mechanism to iterate through a data without any
need of writing a class implementing the Iterator interface.
This feature introduces the keyword yield in PHP 5.5 that
can be used in a function for both inputting and outputting
data.
 Generators
 finally keyword
 New Password Hashing API
before : MD5 , SHA algorithms
Now: password_hash() and password_verify().
** password_hash($password, PASSWORD_DEFAULT)
** password_verify($password, $hash).
 New Password Hashing API
before : MD5 , SHA algorithms
Now: password_hash() and password_verify().
** password_hash($password, PASSWORD_DEFAULT)
** password_verify($password, $hash).
 password_needs_rehash()

boolean password_needs_rehash( string $hash , string


$algoconst [, string $options ] )
 password_get_info()
array and string literal dereferencing

<?php
echo "for God's sake"[6];
echo "<br />";
echo ["Apple", "Boy", "Cat", "Dog"][1];
?>

Output:
d
Boy
 Easier class name resolution

echo myclass::class;
 empty() supports arbitrary expressions
 Support for the list() construct by a foreach loop
 Support for non-scalar keys by a foreach loop

Iterator::key()
 Improved GD extension
imageflip(), imagecrop() and imagecropauto()…
Deprecated features in PHP 5.5
 ext/mysql
 preg_replace()/e modifier
 Mcrypt
 Curlwrappers

 Others : http://us1.php.net/migration55.new-features
Deprecated features in PHP 5.5
 ext/mysql
 preg_replace()/e modifier
 Mcrypt
 Curlwrappers

 Others : http://us1.php.net/migration55.new-features

You might also like