Next Generation of PHP |
Initially PHP started as PHP/FI in 1994 written in c programming language by Rasmus Lerdorf for his personal use.
Later Rasmus recreated PHP with database interaction to use
with advance PHP framework in 1995 and released source code open to all
developers to modify and reporting bugs.
So basically PHP follows C structure and its variable
declaration is similar to Perl syntax for easy adopt by developers who is
familiar with C and similar language.
PHP3: php3 was the first version of PHP release with Object oriented programming support and database connectivity with MySql, PostgreSql by new PHP Development Team in 1998.
PHP4: php3 was not designed to handle complex applications
efficiently to make PHP more powerful and capable to work with complex application
with high efficiency new PHP engine designed name as Zend Engine.
PHP4 was based on Zend Engine with high security and
efficiency to meet complex applications expectation this took nearly two years
and then launched in 2000.
PHP5: After further improvements in php4 new version of PHP
launched which is later became the most popular version of PHP in 2004 with Zend Engine 2.0
PHP6: PHP developers team was working to change some Unicode
binary to make next generation PHP but during development things become complex
and another project started with name PHP7 which have features those expected
in PHP6 and other new features.
Also many blog post and information related to PHP6 shared
by many communities even some authors launched new php books cover page title
as PHP6 but later they changed and updated once officially declare that PHP
will skip PHP6 and will be launch new version name as PHP7, So no PHP6 exist officially.
PHP7: The latest generation of PHP which is mainly developed
to make PHP execution fast, and they successfully achieved twice faster speed
then old versions of PHP.
PHP7 is based on new engine name PHPNG (PHP Next Generation)
HHVM is developed by Facebook team from open source PHP
project and become fastest engine. Later PHP team used the similar concept which
is used in HHVM and developed New Generation PHP which is more faster than
HHVM.
PHP7 is officially launched in 2016 with twice fast speed
than old PHP.
1) Scalar type declarations
3) Null coalescing operator
4) Spaceship operator
7) Unicode codepoint escape syntax
11) Generator Return Expressions
12) Generator delegation
PHP7 is faster than all old PHP versions and some other server side scripts |
New Features of PHP7
1) Scalar type declarations
- <?php
- function addition(int $a, float $b) {
- return $a+$b;
- }
- ?>
2) Return type declarations
- <?php
- function addition(int $a, float $b) {
- return(float) ($a+$b);
- }
- ?>
3) Null coalescing operator
- <?php
- $arr = [‘key’=>’value’];
- $message = isset($arr[‘key’])?$arr[‘key’]:’not set’;
- ?>
4) Spaceship operator
- <?php
- echo 1 <=> 1; // 0
- echo 1.5 <=> 2.5; // -1
- echo "a" <=> "b"; // -1
- ?>
5) Constant arrays using define()
- <?php
- define(‘AREA, [
- ‘triangle’,
- 'circle',
- 'rectangle'
- ]);
- echo AREA [1]; // outputs "triangle"
- ?>
6) Anonymous classes
- <?php
- $str = new class {
- public function str() {
- return ‘string’;
- }
- }
- Calling -> $str->str();
- ?>
7) Unicode codepoint escape syntax
- <?php
- echo "\u{0000aa}";
- ?>
8) Closure::call()
- <?php
- class A {private $x = 1;}
- $getXCB = function() {return $this->x;};
- $getX = $getXCB->bindTo(new A, 'A');
- echo $getX();
- ?>
9) Filtered unserialize()
- <?php
- $data = unserialize($foo, ["allowed_classes" => false]);
- ?>
10) Group use declarations
- <?php
- use some\namespace\ClassA;
- use function some\namespace\fn_a;
- use some\namespace\{ClassA, ClassB, ClassC as C};
- ?>
11) Generator Return Expressions
- <?php
- $gen = (function() {
- yield 1;
- yield 2;
- return 3;
- })();
- foreach ($gen as $val) {
- echo $val, PHP_EOL;
- }
- echo $gen->getReturn(), PHP_EOL;
- ?>
12) Generator delegation
- <?php
- function gen()
- {
- yield 1;
- yield 2;
- yield from gen2();
- }
- function gen2()
- {
- yield 3;
- yield 4;
- }
- foreach (gen() as $val)
- {
- echo $val, PHP_EOL;
- }
- ?>
13) Integer division with intdiv()
- <?php
- var_dump(intdiv(10, 3));
- ?>
14) preg_replace_callback_array()
The new preg_replace_callback_array() function enables code
to be written more cleanly when using the preg_replace_callback()
PHP CMS WordPress is working properly with New version of PHP7 framework Laravel is also supported all features and function added in new generation of PHP and all other frameworks and CMS are replacing deprecated function by updating library new generation is going to make web experience faster.
Now you can test your web application on PHP7 with WAMP new wamp is available with new APACHE and PHP7 support.
Thanks for reading if you have any question add in comments section.
PHP CMS WordPress is working properly with New version of PHP7 framework Laravel is also supported all features and function added in new generation of PHP and all other frameworks and CMS are replacing deprecated function by updating library new generation is going to make web experience faster.
Now you can test your web application on PHP7 with WAMP new wamp is available with new APACHE and PHP7 support.
Thanks for reading if you have any question add in comments section.
PHP is a server side scripting language and most of the developer choice is PHP nowadays, since it is highly secure. Your blog on PHP secureness is unique from other. I hope your content was read by most of the people in the World Wide Web.
ReplyDeleteRegards:
PHP Training in Chennai | PHP Course in Chennai
slot siteleri
ReplyDeletekralbet
betpark
tipobet
mobil ödeme bahis
betmatik
kibris bahis siteleri
poker siteleri
bonus veren siteler
NAZ
sex videos
ReplyDeletetütün sarma makinesi
site kurma
sms onay
binance hesap açma
ZDEV0P