SlideShare a Scribd company logo
1 of 74
Download to read offline
© Haim Michael 2011. All Rights Reserved.
PHP7. Game Changer.
Haim Michael
September 22nd
, 2016
All logos, trade marks and brand names used in this presentation belong
to the respective owners.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Haim Michael Introduction
● Snowboarding. Learning. Coding. Teaching. More than
16 years of Practical Experience.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Haim Michael Introduction
● Professional Certifications
Zend Certified Engineer in PHP
Certified Java Professional
Certified Java EE Web Component Developer
OMG Certified UML Professional
● MBA (cum laude) from Tel-Aviv University
Information Systems Management
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Introduction
 PHP was originally developed by Rasmus Lardorf in
1994, and was publicly released in June 1995. This
released version is known as PHP 2.
 In 1997 Zeev Suraski & Andi Gutmans rewrote PHP
parser and formed the base of PHP 3.
 In 1998 Zeev Suraski & Andi Gutmans started a new
rewrite of PHP core and produced the Zend Engine in
1999.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Introduction
 In May 2000 PHP 4 powered by Zend Engine 1.0 was
released.
 In July 2004 PHP 5 powered by Zend Engine 2.0 was
released.
 PHP 7 was released in November 2015. PHP 7 presents
a significant performance improvement and introduces
more than a few new features and changes. Some of the
changes cause to backwards compatibility breakages.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Performance
 PHP 7 is well known for its performance improvement.
The performance of PHP 7 supersedes even the one
introduced by HHVM, Facebook's recently released new
programming language that was developed based on
PHP.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 7
Zend PHP Engine Improvement
 The changes that were introduced in Zend's PHP engine
include the use of more compact data structures and
less memory allocations on the heap.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 8
Improvement of 100%
 The performance improvement gained in real world
applications varies and depends on the unique
characteristics of each and every web application. In
most cases, the improvement will be around 100%.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 9
Less Memory
 In most cases, thanks to the use of more compact data
structures and less memory allocations on the heap, the
memory consumption will be lower.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 10
Future Improvements
 The work on improving Zend's PHP engine hasn't
reached to its end.
 The additional improvements that can be introduced
into Zend's PHP engine are well listed and wait for their
implementation.
 We can expect more performance improvements in the
future.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 11
BenchMark Tests
 We can find more than a few benchmarking tests that
show the significant performance improvement in Zend
PHP engine.
https://www.zend.com/en/resources/php7_infographic
http://talks.php.net/oz15#/opencartbench
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Backward Compatibility
 Some of the changes introduced by PHP 7 cause
backward compatibility problems.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The <=> Operator
 The <=> operator is known as the combined comparison
operator. Its other name is the spaceship operator.
 It is a shorthand for performing three way comparisons
on two operands. The returned value is an integer, that
can be either positive, negative or 0.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The <=> Operator
<?php
$a = "mama";
$b = "abba";
echo "<h1>a=$a</h1>";
echo "<h1>b=$b</h1>";
$temp = $a <=> $b;
echo "<h1>temp=$temp</h1>";
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The <=> Operator
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The <=> Operator
 When using the <=> operator for comparing strings the
comparison will be a lexicographic one.
 We can use this operator for comparing arrays. The
comparison will be between the elements.
 We cannot use it for comparing objects.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The ?? Operator
 The ?? operator, which is also known as the isset
ternary operator, is a shorthand notation for performing
isset() checks in the ternary operator.
 This new operator assists us with those cases in which
we need to check whether the array we work with has a
specific key so we could use its value and if not, then
another value will be used instead.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The ?? Operator
$vec = ['a'=>'abba','b'=>'baba','m'=>'mama'];
//before PHP7
//$temp = isset($vec['d'])?$vec['d']:'default';
$temp = $vec['d']??'default';
echo "<h1>$temp</h1>";
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The ?? Operator
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Scalar Type Declaration
 As of PHP 7, when declaring a function we can now
specify type for each one of the parameters. We can
specify any of the following scalar types: string, int,
float or bool.
 These types come in addition to the types we could
already use as of PHP 5.x including a class name, an
interface name, array or callable.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Scalar Type Declaration
 When specifying the types of a function parameters we
can either do it in a coercive mode (default) or a strict
mode.
 In order to be in a strict mode we should add the
declare() directive to the beginning of the file. When
in strict mode, if the type check fails then a TypeError
exception will be thrown.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Scalar Type Declaration
 The one exception for this behavior is when assigning a
value of the type int to parameter of the type float.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Scalar Type Declaration
<?php
declare(strict_types=1);
function sum(float $a, float $b)
{
return $a+$b;
}
$temp = sum(3,5);
echo "<h1>$temp</h1>";
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Return Type Declaration
 As of PHP 7, we can specify the type of the returned
value for the function we declare.
 The return type can be string, int, float, bool,
array, callable, self (when defining methods only),
the name of a class or the name of an interface.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Return Type Declaration
 When overriding a method, the type of the returned
value of the new defined method must be the same as of
the overridden method.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Return Type Declaration
<?php
declare(strict_types=1);
function sum(int $a, int $b):float
{
return $a+$b;
}
$temp = sum(sum(5,2),5);
echo "<h1>$temp</h1>";
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Return Type Declaration
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Anonymous Class
 As of PHP 7, we can define an anonymous class. It is
highly useful when in a need for one object only.
 The new anonymous class can extend another class and
implements as many interfaces as we want.
 When defining an anonymous class within the scope of
another class we won't get any access to any of the
private or protected properties of the outer class.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Anonymous Class
<?php
class C {
public function doSomething() {
echo "<h1>something</h1>";
}
}
interface I {}
trait T {}
$ob = new class(10) extends C implements I {
private $num;
public function __construct($num)
{
$this->num = $num;
}
use T;
};
$ob->doSomething();
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Anonymous Class
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Unicode
 PHP 7 allows us to refer specific characters in the
unicode table.
<?php
echo "u{0000a9}";
echo "u{00a9}";
echo "u{a9}";
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The Closure call Function
 Using this function we can invoke a closure function
on object which isn't the one the closure function is
bounded with.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The Closure call Function
<?php
class A {
private $magic;
function __construct($number) {
$this->magic = $number;
}
function getClosure() {
return function() { return $this->magic; };
}
function setMagic($number) {
if($number>0) {
$this->magic = $number;
}
}
}
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The Closure call Function
$ob1 = new A(3);
$ob2 = new A(4);
$ob3 = new A(5);
$f1 = $ob1->getClosure();
echo $f1()."<br/>";
$ob1->setMagic(7);
echo $f1()."<br/>";
$f2 = $f1->bindTo($ob2);
echo $f1()."<br/>";
echo $f2()."<br/>";
echo $f1->call($ob3)."<br/>";
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The Closure call Function
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The unserialize() Function
 When we unserialize an object, as of PHP 7 we can
specify the names of the classes that can be
unserialized.
 Specifying the names of the classes that can be
unserialized improves the security of our code. When
unserializing untrusted data using this function we
prevent possible code injections.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The unserialize() Function
<?php
class A {
private $magic;
function __construct($number) {
$this->setMagic($number);
}
function setMagic($number) {
if($number>0) {
$this->magic = $number;
}
}
function getMagic() {
return $this->magic;
}
}
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The unserialize() Function
$ob1 = new A(5);
$data = serialize($ob1);
$ob2 = unserialize(
$data,
["allowed_classes" => ["A", "Rectangle"]]);
echo $ob2->getMagic();
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Grouping use Declarations
 PHP 7 allows us to group multiple use declarations in
accordance with the parent namespace.
 When grouping together multiple use declarations we get
a clearer code.
 We can group together the import of multiple classes,
functions or constants.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Grouping use Declarations
<?php
/*
use comlifemichaelsamplesClassOne;
use comlifemichaelsamplesClassTwo;
use comlifemichaelsamplesClassThree as C;
use function comlifemichaelsamplesf1;
use function comlifemichaelsamplesf2;
use function comlifemichaelsamplesf3;
use const comlifemichaelsamplesConstantA;
use const comlifemichaelsamplesConstantB;
use const comlifemichaelsamplesConstantC;
*/
use comlifemichaelsamples{ClassOne, ClassTwo, ClassThree as C};
use function comlifemichaelsamples{f1, f2, f3};
use const comlifemichaelsamples{ConstantA, ConstantB, ConstantC};
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Generator Return Expression
 PHP 7 allows us to include a return statement within a
generator function in order to enable for a final
expression to be returned.
 This final expression can be fetched by calling the
getReturn() function on the generator object.
 We can call the getReturn() function when the
generator finished yielding its values only.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Generator Return Expression
<?php
function numbers() {
$sum = 0;
for($i=1;$i<=10;$i++) {
$sum += $i;
yield $i*$i;
}
return $sum;
}
$generator = numbers();
foreach($generator as $v) {
echo "<br/>".$v;
}
echo "<br/>".$generator->getReturn();
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Generator Return Expression
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Generator Delegation
 When developing generator functions, PHP 7 allows us
to use the yield from <expr> syntax in order to have
the iteration taking place from an <expr> expression
that can be an array or any Traversable object.
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Generator Delegation
<?php
function numbers() {
$a = [1,2,3,4];
$b = [10,30,20,60];
yield from $a;
yield from $b;
}
$generator = numbers();
foreach($generator as $v) {
echo "<br/>".$v;
}
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Generator Delegation
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
The session_start() Function
 As of PHP 7, we can call this function and pass over an
array of options (php.ini options) in order to configure the
way this function works.
session_start(['use_only_cookies' => true]);
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 48
The IIFE Syntax
 As of PHP 7 we can define an anonymous function and
immediately invoke it.
({function()})();
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 49
The IIFE Syntax
<?php
(function(){
$a = 3;
$b = 4;
$c = $a + $b;
echo "<h1>".$c."</h1>";
})();
?>
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 50
Invoking Returned Function
 As of PHP 7 we can invoke a function we get in return
when calling another function.
doSomething()();
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 51
Invoking Returned Function
<?php
function doSomething() {
return function() {
echo "<h1>gaga</h1>";
};
}
doSomething()();
?>
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 52
Exceptions in PHP Engine
 As of PHP 7 there are many more new exception types
been used when something goes wrong in the PHP
engine and an exception should be thrown.
TypeError
ParserError
AssertionError
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 53
Exceptions Hierarchy
 As of PHP 7 we have a new exceptions hierarchy. We
have the interface Throwable on top, implemented both
by Error and Exception.
 The Error and Exception classes are on top of two
separated hierarchies.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 54
Exceptions Hierarchy
 This new separation prevents code in PHP 5.x from
catching the new PHP Engine exceptions with catch-all
(catch (Exception $e)) clauses.
 When creating a new exception class we should extend
one of the pre defined classes. We cannot implement
Throwable directly.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 55
Integers
 As of PHP 7, casting NAN and INF into integers will
result in 0. Prior to PHP 7 we would have received a very
long number.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 56
Integers
<?php
$a = NAN;
$b = (int)$a;
echo "<h1>".$b."</h1>";
$a = INF;
$b = (int)$a;
echo "<h1>".$b."</h1>";
?>
PHP 7PHP 5.x
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 57
The JSON Extension
 As of PHP 7, due to legal issues the JSON extension
was replaced with a new one. The JSOND extension.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 58
The foreach Loop Fixes
 PHP 7 introduces fixes into the foreach loop in order to
ensure the same behavior in all PHP implementations.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 59
The list Construct Changes
 As of PHP 7 we cannot use the list construct with
strings. This limitation was introduced in order to have
the same behavior in all PHP engines. Prior to PHP 7, in
some cases it was possible to use the list construct
together with strings.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 60
Division By Zero Changes
 Before PHP 7, when dividing by 0 or calculating modulo
by 0 we got the value false of the type boolean.
 As of PHP 7, when calculating the modulo by 0 the
DivisionByZeroError exception will be thrown and when
trying to divide by 0 we will get +INF, -INF or NAN.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 61
Division By Zero Changes
<?php
$a = -512;
$b = 0;
$temp1 = $a / $b;
echo "<h1>temp1=".$temp1." ".gettype($temp1)."</h1>";
try
{
$temp2 = $a % $b;
echo "<h1>temp2=" . $temp2 . " " . gettype($temp2) . "</h1>";
}
catch(Throwable $throwable)
{
echo "<h1>error happened</h1>";
}
?>
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 62
Division By Zero Changes
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 63
PHP4 Constructors Deprecation
 As of PHP 7, the constructors we define must be named
with the '__construct' name. We should avoid naming
our constructors after the classes in which we define
them.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 64
The date.timezone Warning
 As of PHP 7, we will no longer get the popular
date.timezone warning. So far, in order to remove
that warning we had to have access to PHP.ini. As of
PHP 7 things will be simpler.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 65
The PHP Alternative Tags Removal
 As of PHP 7, the alternative tags <% (and <%=), %>,
<script language="php"> (and </script>) are
no longer supported.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 66
Multiple default Blocks in Switch
 As of PHP 7, it isn't possible to have multiple default
blocks in a switch statement.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 67
Functions Multiple Parameters Names
 As of PHP 7, it is no longer possible to define a function
with two or more parameters with the same name.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 68
Server APIs Removal
 As of PHP 7, lots of server APIs are no longer part of the
core PHP engine.
sapi/apache
sapi/apache_hooks
sapi/thttpd
...
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 69
Numerical Strings Hex Support
 As of PHP 7, strings we create that include hexadecimal
numbers are no longer recognized as numerical.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 70
Deprecated Functionality
 As with the release of PHP 7, many of the deprecated
functionality we know in PHP has been removed.
 One of extensions that was removed is the mysql
extension that allows us to use MySQL in a procedural
way.
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 71
The IIFE Syntax
<?php
(function(){
$a = 3;
$b = 4;
$c = $a + $b;
echo "<h1>".$c."</h1>";
})();
?>
LifeMichael.com
IIFE stands for Immediately Invoked Function Expression
09/22/16 © Haim Michael 2011. All Rights Reserved. 72
Invoking Returned Function
 As of PHP 7 we can invoke a function we get in return
when calling another function.
doSomething()();
LifeMichael.com
09/22/16 © Haim Michael 2011. All Rights Reserved. 73
Invoking Returned Function
<?php
function doSomething() {
return function() {
echo "<h1>gaga</h1>";
};
}
doSomething()();
?>
LifeMichael.com
© Haim Michael 2011. All Rights Reserved.
Questions & Answers
● If you enjoyed my lecture please leave me a comment
at http://speakerpedia.com/speakers/life-michael.
Thanks for your time!
Haim.
LifeMichael.com

More Related Content

What's hot

Perl 101 - The Basics of Perl Programming
Perl  101 - The Basics of Perl ProgrammingPerl  101 - The Basics of Perl Programming
Perl 101 - The Basics of Perl ProgrammingUtkarsh Sengar
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners PerlDave Cross
 
Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best PracticesJosé Castro
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perlsana mateen
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021Ayesh Karunaratne
 
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...anshkhurana01
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Prof. Wim Van Criekinge
 
You Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsYou Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsRoy Zimmer
 
Php Reusing Code And Writing Functions
Php Reusing Code And Writing FunctionsPhp Reusing Code And Writing Functions
Php Reusing Code And Writing Functionsmussawir20
 
Advanced php
Advanced phpAdvanced php
Advanced phpAnne Lee
 
CGI With Object Oriented Perl
CGI With Object Oriented PerlCGI With Object Oriented Perl
CGI With Object Oriented PerlBunty Ray
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Lin Yo-An
 

What's hot (20)

Perl 101 - The Basics of Perl Programming
Perl  101 - The Basics of Perl ProgrammingPerl  101 - The Basics of Perl Programming
Perl 101 - The Basics of Perl Programming
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners Perl
 
Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best Practices
 
Intro to Perl and Bioperl
Intro to Perl and BioperlIntro to Perl and Bioperl
Intro to Perl and Bioperl
 
Functions in PHP
Functions in PHPFunctions in PHP
Functions in PHP
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
 
Perl Introduction
Perl IntroductionPerl Introduction
Perl Introduction
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
 
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013
 
Subroutines
SubroutinesSubroutines
Subroutines
 
You Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsYou Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager Needs
 
Php Reusing Code And Writing Functions
Php Reusing Code And Writing FunctionsPhp Reusing Code And Writing Functions
Php Reusing Code And Writing Functions
 
Advanced php
Advanced phpAdvanced php
Advanced php
 
Perl Programming - 02 Regular Expression
Perl Programming - 02 Regular ExpressionPerl Programming - 02 Regular Expression
Perl Programming - 02 Regular Expression
 
CGI With Object Oriented Perl
CGI With Object Oriented PerlCGI With Object Oriented Perl
CGI With Object Oriented Perl
 
Scalar data types
Scalar data typesScalar data types
Scalar data types
 
Perl Basics with Examples
Perl Basics with ExamplesPerl Basics with Examples
Perl Basics with Examples
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 

Viewers also liked

PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)
PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)
PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)Changwan Jun
 
주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)
주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)
주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)Darion Kim
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)Young-Ho Cho
 
PHP로 Slack Bot 만들기
PHP로 Slack Bot 만들기PHP로 Slack Bot 만들기
PHP로 Slack Bot 만들기Changwan Jun
 
티켓몬스터를 위한 PHP 개발 방법
티켓몬스터를 위한 PHP 개발 방법티켓몬스터를 위한 PHP 개발 방법
티켓몬스터를 위한 PHP 개발 방법Young D
 
このPHP拡張がすごい!2017
このPHP拡張がすごい!2017このPHP拡張がすごい!2017
このPHP拡張がすごい!2017sasezaki
 

Viewers also liked (7)

PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)
PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)
PHP에서 GCM 푸시 빠르게 보내기 (feat. Async / Generator)
 
주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)
주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)
주니어 개발자도 이해 할 수 있는 의존성 주입(Dependency Injection)
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)
 
PHP로 Slack Bot 만들기
PHP로 Slack Bot 만들기PHP로 Slack Bot 만들기
PHP로 Slack Bot 만들기
 
티켓몬스터를 위한 PHP 개발 방법
티켓몬스터를 위한 PHP 개발 방법티켓몬스터를 위한 PHP 개발 방법
티켓몬스터를 위한 PHP 개발 방법
 
このPHP拡張がすごい!2017
このPHP拡張がすごい!2017このPHP拡張がすごい!2017
このPHP拡張がすごい!2017
 
Modern PHP
Modern PHPModern PHP
Modern PHP
 

Similar to PHP7. Game Changer.

What is new in PHP
What is new in PHPWhat is new in PHP
What is new in PHPHaim Michael
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java Haim Michael
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPwahidullah mudaser
 
1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_masterjeeva indra
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQLArti Parab Academics
 
PHP Basics Ebook
PHP Basics EbookPHP Basics Ebook
PHP Basics EbookSwanand Pol
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysqlProgrammer Blog
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPtutorialsruby
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPtutorialsruby
 
Asynchronous JavaScript Programming
Asynchronous JavaScript ProgrammingAsynchronous JavaScript Programming
Asynchronous JavaScript ProgrammingHaim Michael
 
Php tutorial from_beginner_to_master
Php tutorial from_beginner_to_masterPhp tutorial from_beginner_to_master
Php tutorial from_beginner_to_masterPrinceGuru MS
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.pptSanthiNivas
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009cwarren
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Muhamad Al Imran
 

Similar to PHP7. Game Changer. (20)

What is new in PHP
What is new in PHPWhat is new in PHP
What is new in PHP
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master
 
PHP
 PHP PHP
PHP
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
PHP Basics Ebook
PHP Basics EbookPHP Basics Ebook
PHP Basics Ebook
 
phptutorial
phptutorialphptutorial
phptutorial
 
phptutorial
phptutorialphptutorial
phptutorial
 
Guidelines php 8 gig
Guidelines php 8 gigGuidelines php 8 gig
Guidelines php 8 gig
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
 
Asynchronous JavaScript Programming
Asynchronous JavaScript ProgrammingAsynchronous JavaScript Programming
Asynchronous JavaScript Programming
 
Php tutorial from_beginner_to_master
Php tutorial from_beginner_to_masterPhp tutorial from_beginner_to_master
Php tutorial from_beginner_to_master
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 

More from Haim Michael

Virtual Threads in Java
Virtual Threads in JavaVirtual Threads in Java
Virtual Threads in JavaHaim Michael
 
MongoDB Design Patterns
MongoDB Design PatternsMongoDB Design Patterns
MongoDB Design PatternsHaim Michael
 
Introduction to SQL Injections
Introduction to SQL InjectionsIntroduction to SQL Injections
Introduction to SQL InjectionsHaim Michael
 
Record Classes in Java
Record Classes in JavaRecord Classes in Java
Record Classes in JavaHaim Michael
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design PatternsHaim Michael
 
Structural Pattern Matching in Python
Structural Pattern Matching in PythonStructural Pattern Matching in Python
Structural Pattern Matching in PythonHaim Michael
 
Unit Testing in Python
Unit Testing in PythonUnit Testing in Python
Unit Testing in PythonHaim Michael
 
OOP Best Practices in JavaScript
OOP Best Practices in JavaScriptOOP Best Practices in JavaScript
OOP Best Practices in JavaScriptHaim Michael
 
JavaScript Jump Start 20220214
JavaScript Jump Start 20220214JavaScript Jump Start 20220214
JavaScript Jump Start 20220214Haim Michael
 
Bootstrap Jump Start
Bootstrap Jump StartBootstrap Jump Start
Bootstrap Jump StartHaim Michael
 
What is new in Python 3.9
What is new in Python 3.9What is new in Python 3.9
What is new in Python 3.9Haim Michael
 
Programming in Python on Steroid
Programming in Python on SteroidProgramming in Python on Steroid
Programming in Python on SteroidHaim Michael
 
The matplotlib Library
The matplotlib LibraryThe matplotlib Library
The matplotlib LibraryHaim Michael
 
Pandas meetup 20200908
Pandas meetup 20200908Pandas meetup 20200908
Pandas meetup 20200908Haim Michael
 
The num py_library_20200818
The num py_library_20200818The num py_library_20200818
The num py_library_20200818Haim Michael
 
Jupyter notebook 20200728
Jupyter notebook 20200728Jupyter notebook 20200728
Jupyter notebook 20200728Haim Michael
 
Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Haim Michael
 
The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]Haim Michael
 

More from Haim Michael (20)

Anti Patterns
Anti PatternsAnti Patterns
Anti Patterns
 
Virtual Threads in Java
Virtual Threads in JavaVirtual Threads in Java
Virtual Threads in Java
 
MongoDB Design Patterns
MongoDB Design PatternsMongoDB Design Patterns
MongoDB Design Patterns
 
Introduction to SQL Injections
Introduction to SQL InjectionsIntroduction to SQL Injections
Introduction to SQL Injections
 
Record Classes in Java
Record Classes in JavaRecord Classes in Java
Record Classes in Java
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
 
Structural Pattern Matching in Python
Structural Pattern Matching in PythonStructural Pattern Matching in Python
Structural Pattern Matching in Python
 
Unit Testing in Python
Unit Testing in PythonUnit Testing in Python
Unit Testing in Python
 
OOP Best Practices in JavaScript
OOP Best Practices in JavaScriptOOP Best Practices in JavaScript
OOP Best Practices in JavaScript
 
Java Jump Start
Java Jump StartJava Jump Start
Java Jump Start
 
JavaScript Jump Start 20220214
JavaScript Jump Start 20220214JavaScript Jump Start 20220214
JavaScript Jump Start 20220214
 
Bootstrap Jump Start
Bootstrap Jump StartBootstrap Jump Start
Bootstrap Jump Start
 
What is new in Python 3.9
What is new in Python 3.9What is new in Python 3.9
What is new in Python 3.9
 
Programming in Python on Steroid
Programming in Python on SteroidProgramming in Python on Steroid
Programming in Python on Steroid
 
The matplotlib Library
The matplotlib LibraryThe matplotlib Library
The matplotlib Library
 
Pandas meetup 20200908
Pandas meetup 20200908Pandas meetup 20200908
Pandas meetup 20200908
 
The num py_library_20200818
The num py_library_20200818The num py_library_20200818
The num py_library_20200818
 
Jupyter notebook 20200728
Jupyter notebook 20200728Jupyter notebook 20200728
Jupyter notebook 20200728
 
Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start)
 
The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]
 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

PHP7. Game Changer.

  • 1. © Haim Michael 2011. All Rights Reserved. PHP7. Game Changer. Haim Michael September 22nd , 2016 All logos, trade marks and brand names used in this presentation belong to the respective owners. LifeMichael.com
  • 2. © Haim Michael 2011. All Rights Reserved. Haim Michael Introduction ● Snowboarding. Learning. Coding. Teaching. More than 16 years of Practical Experience. LifeMichael.com
  • 3. © Haim Michael 2011. All Rights Reserved. Haim Michael Introduction ● Professional Certifications Zend Certified Engineer in PHP Certified Java Professional Certified Java EE Web Component Developer OMG Certified UML Professional ● MBA (cum laude) from Tel-Aviv University Information Systems Management LifeMichael.com
  • 4. © Haim Michael 2011. All Rights Reserved. Introduction  PHP was originally developed by Rasmus Lardorf in 1994, and was publicly released in June 1995. This released version is known as PHP 2.  In 1997 Zeev Suraski & Andi Gutmans rewrote PHP parser and formed the base of PHP 3.  In 1998 Zeev Suraski & Andi Gutmans started a new rewrite of PHP core and produced the Zend Engine in 1999. LifeMichael.com
  • 5. © Haim Michael 2011. All Rights Reserved. Introduction  In May 2000 PHP 4 powered by Zend Engine 1.0 was released.  In July 2004 PHP 5 powered by Zend Engine 2.0 was released.  PHP 7 was released in November 2015. PHP 7 presents a significant performance improvement and introduces more than a few new features and changes. Some of the changes cause to backwards compatibility breakages. LifeMichael.com
  • 6. © Haim Michael 2011. All Rights Reserved. Performance  PHP 7 is well known for its performance improvement. The performance of PHP 7 supersedes even the one introduced by HHVM, Facebook's recently released new programming language that was developed based on PHP. LifeMichael.com
  • 7. 09/22/16 © Haim Michael 2011. All Rights Reserved. 7 Zend PHP Engine Improvement  The changes that were introduced in Zend's PHP engine include the use of more compact data structures and less memory allocations on the heap. LifeMichael.com
  • 8. 09/22/16 © Haim Michael 2011. All Rights Reserved. 8 Improvement of 100%  The performance improvement gained in real world applications varies and depends on the unique characteristics of each and every web application. In most cases, the improvement will be around 100%. LifeMichael.com
  • 9. 09/22/16 © Haim Michael 2011. All Rights Reserved. 9 Less Memory  In most cases, thanks to the use of more compact data structures and less memory allocations on the heap, the memory consumption will be lower. LifeMichael.com
  • 10. 09/22/16 © Haim Michael 2011. All Rights Reserved. 10 Future Improvements  The work on improving Zend's PHP engine hasn't reached to its end.  The additional improvements that can be introduced into Zend's PHP engine are well listed and wait for their implementation.  We can expect more performance improvements in the future. LifeMichael.com
  • 11. 09/22/16 © Haim Michael 2011. All Rights Reserved. 11 BenchMark Tests  We can find more than a few benchmarking tests that show the significant performance improvement in Zend PHP engine. https://www.zend.com/en/resources/php7_infographic http://talks.php.net/oz15#/opencartbench LifeMichael.com
  • 12. © Haim Michael 2011. All Rights Reserved. Backward Compatibility  Some of the changes introduced by PHP 7 cause backward compatibility problems. LifeMichael.com
  • 13. © Haim Michael 2011. All Rights Reserved. The <=> Operator  The <=> operator is known as the combined comparison operator. Its other name is the spaceship operator.  It is a shorthand for performing three way comparisons on two operands. The returned value is an integer, that can be either positive, negative or 0. LifeMichael.com
  • 14. © Haim Michael 2011. All Rights Reserved. The <=> Operator <?php $a = "mama"; $b = "abba"; echo "<h1>a=$a</h1>"; echo "<h1>b=$b</h1>"; $temp = $a <=> $b; echo "<h1>temp=$temp</h1>"; ?> LifeMichael.com
  • 15. © Haim Michael 2011. All Rights Reserved. The <=> Operator LifeMichael.com
  • 16. © Haim Michael 2011. All Rights Reserved. The <=> Operator  When using the <=> operator for comparing strings the comparison will be a lexicographic one.  We can use this operator for comparing arrays. The comparison will be between the elements.  We cannot use it for comparing objects. LifeMichael.com
  • 17. © Haim Michael 2011. All Rights Reserved. The ?? Operator  The ?? operator, which is also known as the isset ternary operator, is a shorthand notation for performing isset() checks in the ternary operator.  This new operator assists us with those cases in which we need to check whether the array we work with has a specific key so we could use its value and if not, then another value will be used instead. LifeMichael.com
  • 18. © Haim Michael 2011. All Rights Reserved. The ?? Operator $vec = ['a'=>'abba','b'=>'baba','m'=>'mama']; //before PHP7 //$temp = isset($vec['d'])?$vec['d']:'default'; $temp = $vec['d']??'default'; echo "<h1>$temp</h1>"; LifeMichael.com
  • 19. © Haim Michael 2011. All Rights Reserved. The ?? Operator LifeMichael.com
  • 20. © Haim Michael 2011. All Rights Reserved. Scalar Type Declaration  As of PHP 7, when declaring a function we can now specify type for each one of the parameters. We can specify any of the following scalar types: string, int, float or bool.  These types come in addition to the types we could already use as of PHP 5.x including a class name, an interface name, array or callable. LifeMichael.com
  • 21. © Haim Michael 2011. All Rights Reserved. Scalar Type Declaration  When specifying the types of a function parameters we can either do it in a coercive mode (default) or a strict mode.  In order to be in a strict mode we should add the declare() directive to the beginning of the file. When in strict mode, if the type check fails then a TypeError exception will be thrown. LifeMichael.com
  • 22. © Haim Michael 2011. All Rights Reserved. Scalar Type Declaration  The one exception for this behavior is when assigning a value of the type int to parameter of the type float. LifeMichael.com
  • 23. © Haim Michael 2011. All Rights Reserved. Scalar Type Declaration <?php declare(strict_types=1); function sum(float $a, float $b) { return $a+$b; } $temp = sum(3,5); echo "<h1>$temp</h1>"; ?> LifeMichael.com
  • 24. © Haim Michael 2011. All Rights Reserved. Return Type Declaration  As of PHP 7, we can specify the type of the returned value for the function we declare.  The return type can be string, int, float, bool, array, callable, self (when defining methods only), the name of a class or the name of an interface. LifeMichael.com
  • 25. © Haim Michael 2011. All Rights Reserved. Return Type Declaration  When overriding a method, the type of the returned value of the new defined method must be the same as of the overridden method. LifeMichael.com
  • 26. © Haim Michael 2011. All Rights Reserved. Return Type Declaration <?php declare(strict_types=1); function sum(int $a, int $b):float { return $a+$b; } $temp = sum(sum(5,2),5); echo "<h1>$temp</h1>"; ?> LifeMichael.com
  • 27. © Haim Michael 2011. All Rights Reserved. Return Type Declaration LifeMichael.com
  • 28. © Haim Michael 2011. All Rights Reserved. Anonymous Class  As of PHP 7, we can define an anonymous class. It is highly useful when in a need for one object only.  The new anonymous class can extend another class and implements as many interfaces as we want.  When defining an anonymous class within the scope of another class we won't get any access to any of the private or protected properties of the outer class. LifeMichael.com
  • 29. © Haim Michael 2011. All Rights Reserved. Anonymous Class <?php class C { public function doSomething() { echo "<h1>something</h1>"; } } interface I {} trait T {} $ob = new class(10) extends C implements I { private $num; public function __construct($num) { $this->num = $num; } use T; }; $ob->doSomething(); ?> LifeMichael.com
  • 30. © Haim Michael 2011. All Rights Reserved. Anonymous Class LifeMichael.com
  • 31. © Haim Michael 2011. All Rights Reserved. Unicode  PHP 7 allows us to refer specific characters in the unicode table. <?php echo "u{0000a9}"; echo "u{00a9}"; echo "u{a9}"; ?> LifeMichael.com
  • 32. © Haim Michael 2011. All Rights Reserved. The Closure call Function  Using this function we can invoke a closure function on object which isn't the one the closure function is bounded with. LifeMichael.com
  • 33. © Haim Michael 2011. All Rights Reserved. The Closure call Function <?php class A { private $magic; function __construct($number) { $this->magic = $number; } function getClosure() { return function() { return $this->magic; }; } function setMagic($number) { if($number>0) { $this->magic = $number; } } } LifeMichael.com
  • 34. © Haim Michael 2011. All Rights Reserved. The Closure call Function $ob1 = new A(3); $ob2 = new A(4); $ob3 = new A(5); $f1 = $ob1->getClosure(); echo $f1()."<br/>"; $ob1->setMagic(7); echo $f1()."<br/>"; $f2 = $f1->bindTo($ob2); echo $f1()."<br/>"; echo $f2()."<br/>"; echo $f1->call($ob3)."<br/>"; ?> LifeMichael.com
  • 35. © Haim Michael 2011. All Rights Reserved. The Closure call Function LifeMichael.com
  • 36. © Haim Michael 2011. All Rights Reserved. The unserialize() Function  When we unserialize an object, as of PHP 7 we can specify the names of the classes that can be unserialized.  Specifying the names of the classes that can be unserialized improves the security of our code. When unserializing untrusted data using this function we prevent possible code injections. LifeMichael.com
  • 37. © Haim Michael 2011. All Rights Reserved. The unserialize() Function <?php class A { private $magic; function __construct($number) { $this->setMagic($number); } function setMagic($number) { if($number>0) { $this->magic = $number; } } function getMagic() { return $this->magic; } } LifeMichael.com
  • 38. © Haim Michael 2011. All Rights Reserved. The unserialize() Function $ob1 = new A(5); $data = serialize($ob1); $ob2 = unserialize( $data, ["allowed_classes" => ["A", "Rectangle"]]); echo $ob2->getMagic(); ?> LifeMichael.com
  • 39. © Haim Michael 2011. All Rights Reserved. Grouping use Declarations  PHP 7 allows us to group multiple use declarations in accordance with the parent namespace.  When grouping together multiple use declarations we get a clearer code.  We can group together the import of multiple classes, functions or constants. LifeMichael.com
  • 40. © Haim Michael 2011. All Rights Reserved. Grouping use Declarations <?php /* use comlifemichaelsamplesClassOne; use comlifemichaelsamplesClassTwo; use comlifemichaelsamplesClassThree as C; use function comlifemichaelsamplesf1; use function comlifemichaelsamplesf2; use function comlifemichaelsamplesf3; use const comlifemichaelsamplesConstantA; use const comlifemichaelsamplesConstantB; use const comlifemichaelsamplesConstantC; */ use comlifemichaelsamples{ClassOne, ClassTwo, ClassThree as C}; use function comlifemichaelsamples{f1, f2, f3}; use const comlifemichaelsamples{ConstantA, ConstantB, ConstantC}; ?> LifeMichael.com
  • 41. © Haim Michael 2011. All Rights Reserved. Generator Return Expression  PHP 7 allows us to include a return statement within a generator function in order to enable for a final expression to be returned.  This final expression can be fetched by calling the getReturn() function on the generator object.  We can call the getReturn() function when the generator finished yielding its values only. LifeMichael.com
  • 42. © Haim Michael 2011. All Rights Reserved. Generator Return Expression <?php function numbers() { $sum = 0; for($i=1;$i<=10;$i++) { $sum += $i; yield $i*$i; } return $sum; } $generator = numbers(); foreach($generator as $v) { echo "<br/>".$v; } echo "<br/>".$generator->getReturn(); ?> LifeMichael.com
  • 43. © Haim Michael 2011. All Rights Reserved. Generator Return Expression LifeMichael.com
  • 44. © Haim Michael 2011. All Rights Reserved. Generator Delegation  When developing generator functions, PHP 7 allows us to use the yield from <expr> syntax in order to have the iteration taking place from an <expr> expression that can be an array or any Traversable object. LifeMichael.com
  • 45. © Haim Michael 2011. All Rights Reserved. Generator Delegation <?php function numbers() { $a = [1,2,3,4]; $b = [10,30,20,60]; yield from $a; yield from $b; } $generator = numbers(); foreach($generator as $v) { echo "<br/>".$v; } ?> LifeMichael.com
  • 46. © Haim Michael 2011. All Rights Reserved. Generator Delegation LifeMichael.com
  • 47. © Haim Michael 2011. All Rights Reserved. The session_start() Function  As of PHP 7, we can call this function and pass over an array of options (php.ini options) in order to configure the way this function works. session_start(['use_only_cookies' => true]); LifeMichael.com
  • 48. 09/22/16 © Haim Michael 2011. All Rights Reserved. 48 The IIFE Syntax  As of PHP 7 we can define an anonymous function and immediately invoke it. ({function()})(); LifeMichael.com
  • 49. 09/22/16 © Haim Michael 2011. All Rights Reserved. 49 The IIFE Syntax <?php (function(){ $a = 3; $b = 4; $c = $a + $b; echo "<h1>".$c."</h1>"; })(); ?> LifeMichael.com
  • 50. 09/22/16 © Haim Michael 2011. All Rights Reserved. 50 Invoking Returned Function  As of PHP 7 we can invoke a function we get in return when calling another function. doSomething()(); LifeMichael.com
  • 51. 09/22/16 © Haim Michael 2011. All Rights Reserved. 51 Invoking Returned Function <?php function doSomething() { return function() { echo "<h1>gaga</h1>"; }; } doSomething()(); ?> LifeMichael.com
  • 52. 09/22/16 © Haim Michael 2011. All Rights Reserved. 52 Exceptions in PHP Engine  As of PHP 7 there are many more new exception types been used when something goes wrong in the PHP engine and an exception should be thrown. TypeError ParserError AssertionError LifeMichael.com
  • 53. 09/22/16 © Haim Michael 2011. All Rights Reserved. 53 Exceptions Hierarchy  As of PHP 7 we have a new exceptions hierarchy. We have the interface Throwable on top, implemented both by Error and Exception.  The Error and Exception classes are on top of two separated hierarchies. LifeMichael.com
  • 54. 09/22/16 © Haim Michael 2011. All Rights Reserved. 54 Exceptions Hierarchy  This new separation prevents code in PHP 5.x from catching the new PHP Engine exceptions with catch-all (catch (Exception $e)) clauses.  When creating a new exception class we should extend one of the pre defined classes. We cannot implement Throwable directly. LifeMichael.com
  • 55. 09/22/16 © Haim Michael 2011. All Rights Reserved. 55 Integers  As of PHP 7, casting NAN and INF into integers will result in 0. Prior to PHP 7 we would have received a very long number. LifeMichael.com
  • 56. 09/22/16 © Haim Michael 2011. All Rights Reserved. 56 Integers <?php $a = NAN; $b = (int)$a; echo "<h1>".$b."</h1>"; $a = INF; $b = (int)$a; echo "<h1>".$b."</h1>"; ?> PHP 7PHP 5.x LifeMichael.com
  • 57. 09/22/16 © Haim Michael 2011. All Rights Reserved. 57 The JSON Extension  As of PHP 7, due to legal issues the JSON extension was replaced with a new one. The JSOND extension. LifeMichael.com
  • 58. 09/22/16 © Haim Michael 2011. All Rights Reserved. 58 The foreach Loop Fixes  PHP 7 introduces fixes into the foreach loop in order to ensure the same behavior in all PHP implementations. LifeMichael.com
  • 59. 09/22/16 © Haim Michael 2011. All Rights Reserved. 59 The list Construct Changes  As of PHP 7 we cannot use the list construct with strings. This limitation was introduced in order to have the same behavior in all PHP engines. Prior to PHP 7, in some cases it was possible to use the list construct together with strings. LifeMichael.com
  • 60. 09/22/16 © Haim Michael 2011. All Rights Reserved. 60 Division By Zero Changes  Before PHP 7, when dividing by 0 or calculating modulo by 0 we got the value false of the type boolean.  As of PHP 7, when calculating the modulo by 0 the DivisionByZeroError exception will be thrown and when trying to divide by 0 we will get +INF, -INF or NAN. LifeMichael.com
  • 61. 09/22/16 © Haim Michael 2011. All Rights Reserved. 61 Division By Zero Changes <?php $a = -512; $b = 0; $temp1 = $a / $b; echo "<h1>temp1=".$temp1." ".gettype($temp1)."</h1>"; try { $temp2 = $a % $b; echo "<h1>temp2=" . $temp2 . " " . gettype($temp2) . "</h1>"; } catch(Throwable $throwable) { echo "<h1>error happened</h1>"; } ?> LifeMichael.com
  • 62. 09/22/16 © Haim Michael 2011. All Rights Reserved. 62 Division By Zero Changes LifeMichael.com
  • 63. 09/22/16 © Haim Michael 2011. All Rights Reserved. 63 PHP4 Constructors Deprecation  As of PHP 7, the constructors we define must be named with the '__construct' name. We should avoid naming our constructors after the classes in which we define them. LifeMichael.com
  • 64. 09/22/16 © Haim Michael 2011. All Rights Reserved. 64 The date.timezone Warning  As of PHP 7, we will no longer get the popular date.timezone warning. So far, in order to remove that warning we had to have access to PHP.ini. As of PHP 7 things will be simpler. LifeMichael.com
  • 65. 09/22/16 © Haim Michael 2011. All Rights Reserved. 65 The PHP Alternative Tags Removal  As of PHP 7, the alternative tags <% (and <%=), %>, <script language="php"> (and </script>) are no longer supported. LifeMichael.com
  • 66. 09/22/16 © Haim Michael 2011. All Rights Reserved. 66 Multiple default Blocks in Switch  As of PHP 7, it isn't possible to have multiple default blocks in a switch statement. LifeMichael.com
  • 67. 09/22/16 © Haim Michael 2011. All Rights Reserved. 67 Functions Multiple Parameters Names  As of PHP 7, it is no longer possible to define a function with two or more parameters with the same name. LifeMichael.com
  • 68. 09/22/16 © Haim Michael 2011. All Rights Reserved. 68 Server APIs Removal  As of PHP 7, lots of server APIs are no longer part of the core PHP engine. sapi/apache sapi/apache_hooks sapi/thttpd ... LifeMichael.com
  • 69. 09/22/16 © Haim Michael 2011. All Rights Reserved. 69 Numerical Strings Hex Support  As of PHP 7, strings we create that include hexadecimal numbers are no longer recognized as numerical. LifeMichael.com
  • 70. 09/22/16 © Haim Michael 2011. All Rights Reserved. 70 Deprecated Functionality  As with the release of PHP 7, many of the deprecated functionality we know in PHP has been removed.  One of extensions that was removed is the mysql extension that allows us to use MySQL in a procedural way. LifeMichael.com
  • 71. 09/22/16 © Haim Michael 2011. All Rights Reserved. 71 The IIFE Syntax <?php (function(){ $a = 3; $b = 4; $c = $a + $b; echo "<h1>".$c."</h1>"; })(); ?> LifeMichael.com IIFE stands for Immediately Invoked Function Expression
  • 72. 09/22/16 © Haim Michael 2011. All Rights Reserved. 72 Invoking Returned Function  As of PHP 7 we can invoke a function we get in return when calling another function. doSomething()(); LifeMichael.com
  • 73. 09/22/16 © Haim Michael 2011. All Rights Reserved. 73 Invoking Returned Function <?php function doSomething() { return function() { echo "<h1>gaga</h1>"; }; } doSomething()(); ?> LifeMichael.com
  • 74. © Haim Michael 2011. All Rights Reserved. Questions & Answers ● If you enjoyed my lecture please leave me a comment at http://speakerpedia.com/speakers/life-michael. Thanks for your time! Haim. LifeMichael.com