SlideShare a Scribd company logo
1 of 29
Migrer de PHP4 à PHP5 Analyse de code et revue des principaux changements
Qui parle ? ,[object Object]
Formateur - consultant Anaska Alter-Way ,[object Object],[object Object]
Membre AFUP
Auteur ,[object Object],[object Object],[object Object]
PHP
Apache
Evolution de PHP ,[object Object]
PHP5 = PHP5.2.9 aujourd'hui, c'est important !
PHP5 est en évolution permanente
Demain PHP5.3 arrive, après demain PHP6
Voyons les grandes lignes techniques d'une migration
Plan ,[object Object]
Traitements XML améliorés
Utilisation de bases de données ,[object Object],[object Object]
Conclusion
Le modèle objet de PHP5 ,[object Object]
On utilise " -> " plutot que " [ " et " ] "
C'est tout ... ,[object Object],[object Object]
Permet beaucoup plus de chose que simplement utiliser " -> "
Modèle objet de PHP5 : références ,[object Object]
Mais leur comportement est identique class Foo { public function maFonction($arg1) { } } $a = new Foo; class Foo { function maFonction($arg1) { } } $a = &new Foo;
Modèle objet de PHP5 : références ,[object Object],class Foo { public $attribut = 'hello'; public function maFonction($arg1) { } } $a = new Foo; $b = $a; $a->attribut = 'changé'; echo $b->attribut // 'changé' class Foo { var $attribut = 'hello'; function maFonction($arg1) { } } $a = &new Foo; $b = &$a; $a->attribut = 'changé'; echo $b->attribut // 'changé'
Modèle objet de PHP5 : clonage ,[object Object],$a = new Foo; $b =  clone  $a; $c = $a; $a->attribut = 'solutionslinux'; echo $b->attribut; // attribut echo $c->attribut; // solutionslinux $a = &new Foo; $b = $a; $c = &$a; $a->attribut = 'solutionslinux'; echo $b->attribut; // attribut echo $c->attribut; // solutionslinux
Modèle objet de PHP5 : visibilités ,[object Object]
PHP5 introduit "public", "protected", "private" class Foo { var $a; // ok, pas de problème, sera publique function bar(); // idem : sera publique } class Foo { var $a; function bar(); }
Modèle objet de PHP5 : casse ,[object Object],class Foo { function HeLLo() { } } class bAr extends Foo {} $a = new bar; echo get_class($a);  // bAr print_r(get_class_methods($a)); // array ("HeLLo"); echo get_parent_class($a);  //Foo class Foo { function HeLLo() { } } class bAr extends Foo {} $a = &new bar; echo get_class($a);  // bar print_r(get_class_methods($a)); // array("hello"); echo get_parent_class($a);  // foo
Mode de compatibilité modèle objet PHP5 ,[object Object]
Mis à zéro par défaut (comportement PHP5) ,[object Object],[object Object]

More Related Content

What's hot

PHP 7 et Symfony 3
PHP 7 et Symfony 3PHP 7 et Symfony 3
PHP 7 et Symfony 3Eddy RICHARD
 
PHP 5.3, PHP Next
PHP 5.3, PHP NextPHP 5.3, PHP Next
PHP 5.3, PHP NextSQLI
 
Communications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHPCommunications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHPjulien pauli
 
PHP #1 : introduction
PHP #1 : introductionPHP #1 : introduction
PHP #1 : introductionJean Michel
 
PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4julien pauli
 
Bases de PHP - Partie 1
Bases de PHP - Partie 1Bases de PHP - Partie 1
Bases de PHP - Partie 1Régis Lutter
 
Programmation web cours php -- sahmi academy
Programmation web   cours php -- sahmi academyProgrammation web   cours php -- sahmi academy
Programmation web cours php -- sahmi academySoufiane SAHMI
 
ZendFramework2 - Présentation
ZendFramework2 - PrésentationZendFramework2 - Présentation
ZendFramework2 - Présentationjulien pauli
 
PHP (Partie I) Par Mahdi Ben Alaya
PHP (Partie I) Par Mahdi Ben AlayaPHP (Partie I) Par Mahdi Ben Alaya
PHP (Partie I) Par Mahdi Ben AlayaMahdi Ben Alaya
 
PHP (Partie II) Par Mahdi Ben Alaya
PHP (Partie II) Par Mahdi Ben AlayaPHP (Partie II) Par Mahdi Ben Alaya
PHP (Partie II) Par Mahdi Ben AlayaMahdi Ben Alaya
 
Alfresco en quelques points - Recherche Tutorial
Alfresco en quelques points - Recherche TutorialAlfresco en quelques points - Recherche Tutorial
Alfresco en quelques points - Recherche TutorialPASCAL Jean Marie
 
Per lameliorer
Per lameliorerPer lameliorer
Per lameliorerTECOS
 

What's hot (18)

Cours php
Cours phpCours php
Cours php
 
PHP 7 et Symfony 3
PHP 7 et Symfony 3PHP 7 et Symfony 3
PHP 7 et Symfony 3
 
PHP 5.3, PHP Next
PHP 5.3, PHP NextPHP 5.3, PHP Next
PHP 5.3, PHP Next
 
Communications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHPCommunications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHP
 
PHP Training
PHP TrainingPHP Training
PHP Training
 
PHP #1 : introduction
PHP #1 : introductionPHP #1 : introduction
PHP #1 : introduction
 
PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4
 
Etes vous-pret pour php8 ?
Etes vous-pret pour php8 ?Etes vous-pret pour php8 ?
Etes vous-pret pour php8 ?
 
Bases de PHP - Partie 1
Bases de PHP - Partie 1Bases de PHP - Partie 1
Bases de PHP - Partie 1
 
Php cours
Php coursPhp cours
Php cours
 
Programmation web cours php -- sahmi academy
Programmation web   cours php -- sahmi academyProgrammation web   cours php -- sahmi academy
Programmation web cours php -- sahmi academy
 
ZendFramework2 - Présentation
ZendFramework2 - PrésentationZendFramework2 - Présentation
ZendFramework2 - Présentation
 
Langage Perl
Langage PerlLangage Perl
Langage Perl
 
PHP (Partie I) Par Mahdi Ben Alaya
PHP (Partie I) Par Mahdi Ben AlayaPHP (Partie I) Par Mahdi Ben Alaya
PHP (Partie I) Par Mahdi Ben Alaya
 
PHP (Partie II) Par Mahdi Ben Alaya
PHP (Partie II) Par Mahdi Ben AlayaPHP (Partie II) Par Mahdi Ben Alaya
PHP (Partie II) Par Mahdi Ben Alaya
 
Initiation au langage PHP
Initiation au langage PHPInitiation au langage PHP
Initiation au langage PHP
 
Alfresco en quelques points - Recherche Tutorial
Alfresco en quelques points - Recherche TutorialAlfresco en quelques points - Recherche Tutorial
Alfresco en quelques points - Recherche Tutorial
 
Per lameliorer
Per lameliorerPer lameliorer
Per lameliorer
 

Viewers also liked

English result pre-intermediate_wb
English result pre-intermediate_wbEnglish result pre-intermediate_wb
English result pre-intermediate_wbSico Olivera
 
English result pre int sb
English result pre int sbEnglish result pre int sb
English result pre int sbLuna61 Luna
 
Business result elementary sb
Business result elementary sbBusiness result elementary sb
Business result elementary sbEdnilson Faria
 
English Result Intermediate Student´s Book pdf file
English Result Intermediate Student´s Book pdf fileEnglish Result Intermediate Student´s Book pdf file
English Result Intermediate Student´s Book pdf fileM. Mabel Otero
 
The business - intermediate Book!!!
The business - intermediate Book!!!The business - intermediate Book!!!
The business - intermediate Book!!!Jenlytine
 
présentation migration automatisee Pacbase -> UML + Java
présentation migration automatisee Pacbase -> UML + Javaprésentation migration automatisee Pacbase -> UML + Java
présentation migration automatisee Pacbase -> UML + JavaDidier Durand
 
Tests de performances d'une application Java EE
Tests de performances d'une application Java EETests de performances d'une application Java EE
Tests de performances d'une application Java EEAntonio Gomes Rodrigues
 
PFE BI - INPT
PFE BI - INPTPFE BI - INPT
PFE BI - INPTriyadadva
 
English result elementary tb
English result elementary tbEnglish result elementary tb
English result elementary tbSameh Khanfir
 
Business basics student's book
Business basics student's bookBusiness basics student's book
Business basics student's bookpepitagimenez7
 

Viewers also liked (13)

Migration VB6 > .Net
Migration VB6 > .NetMigration VB6 > .Net
Migration VB6 > .Net
 
English result pre-intermediate_wb
English result pre-intermediate_wbEnglish result pre-intermediate_wb
English result pre-intermediate_wb
 
English result pre int sb
English result pre int sbEnglish result pre int sb
English result pre int sb
 
Business result elementary sb
Business result elementary sbBusiness result elementary sb
Business result elementary sb
 
English Result Intermediate Student´s Book pdf file
English Result Intermediate Student´s Book pdf fileEnglish Result Intermediate Student´s Book pdf file
English Result Intermediate Student´s Book pdf file
 
The business - intermediate Book!!!
The business - intermediate Book!!!The business - intermediate Book!!!
The business - intermediate Book!!!
 
Migration
MigrationMigration
Migration
 
Migration
MigrationMigration
Migration
 
présentation migration automatisee Pacbase -> UML + Java
présentation migration automatisee Pacbase -> UML + Javaprésentation migration automatisee Pacbase -> UML + Java
présentation migration automatisee Pacbase -> UML + Java
 
Tests de performances d'une application Java EE
Tests de performances d'une application Java EETests de performances d'une application Java EE
Tests de performances d'une application Java EE
 
PFE BI - INPT
PFE BI - INPTPFE BI - INPT
PFE BI - INPT
 
English result elementary tb
English result elementary tbEnglish result elementary tb
English result elementary tb
 
Business basics student's book
Business basics student's bookBusiness basics student's book
Business basics student's book
 

Similar to Migration PHP4-PHP5

Patterns and OOP in PHP
Patterns and OOP in PHPPatterns and OOP in PHP
Patterns and OOP in PHPjulien pauli
 
Php 7.4 2020-01-28 - afup
Php 7.4   2020-01-28 - afupPhp 7.4   2020-01-28 - afup
Php 7.4 2020-01-28 - afupJulien Vinber
 
Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4Damien Seguy
 
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdfCours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdfRihabBENLAMINE
 
Php trollons mais trollons bien (Bdx.io 2015)
Php trollons mais trollons bien (Bdx.io 2015)Php trollons mais trollons bien (Bdx.io 2015)
Php trollons mais trollons bien (Bdx.io 2015)Arnaud Langlade
 
Les principes de base de PHP
 Les principes de base de PHP  Les principes de base de PHP
Les principes de base de PHP EL JAOUARI Ahmed
 
Php 7 Think php7
Php 7 Think php7Php 7 Think php7
Php 7 Think php7neuros
 
PHP 5.3 : les nouveautés du futur si proche
PHP 5.3 : les nouveautés du futur si prochePHP 5.3 : les nouveautés du futur si proche
PHP 5.3 : les nouveautés du futur si prochePascal MARTIN
 
Php_Mysql.pdf
Php_Mysql.pdfPhp_Mysql.pdf
Php_Mysql.pdfETTAMRY
 
Cours php & Mysql - 1ére partie
Cours php & Mysql - 1ére partieCours php & Mysql - 1ére partie
Cours php & Mysql - 1ére partiekadzaki
 

Similar to Migration PHP4-PHP5 (20)

Patterns and OOP in PHP
Patterns and OOP in PHPPatterns and OOP in PHP
Patterns and OOP in PHP
 
Php 7.4 2020-01-28 - afup
Php 7.4   2020-01-28 - afupPhp 7.4   2020-01-28 - afup
Php 7.4 2020-01-28 - afup
 
Playing With PHP 5.3
Playing With PHP 5.3Playing With PHP 5.3
Playing With PHP 5.3
 
Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4
 
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdfCours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
 
Php trollons mais trollons bien (Bdx.io 2015)
Php trollons mais trollons bien (Bdx.io 2015)Php trollons mais trollons bien (Bdx.io 2015)
Php trollons mais trollons bien (Bdx.io 2015)
 
Spring 3.0
Spring 3.0Spring 3.0
Spring 3.0
 
Cours Php
Cours PhpCours Php
Cours Php
 
Cours Php
Cours PhpCours Php
Cours Php
 
PHP mysql Xml.doc
PHP mysql Xml.docPHP mysql Xml.doc
PHP mysql Xml.doc
 
Les principes de base de PHP
 Les principes de base de PHP  Les principes de base de PHP
Les principes de base de PHP
 
PHP mysql Xml.pdf
PHP mysql Xml.pdfPHP mysql Xml.pdf
PHP mysql Xml.pdf
 
PHP.pptx
PHP.pptxPHP.pptx
PHP.pptx
 
Introduction à PHP
Introduction à PHPIntroduction à PHP
Introduction à PHP
 
Php 7 Think php7
Php 7 Think php7Php 7 Think php7
Php 7 Think php7
 
PHP 5.3 : les nouveautés du futur si proche
PHP 5.3 : les nouveautés du futur si prochePHP 5.3 : les nouveautés du futur si proche
PHP 5.3 : les nouveautés du futur si proche
 
Php_Mysql.pdf
Php_Mysql.pdfPhp_Mysql.pdf
Php_Mysql.pdf
 
Php seance1
Php seance1Php seance1
Php seance1
 
Php 5.3
Php 5.3Php 5.3
Php 5.3
 
Cours php & Mysql - 1ére partie
Cours php & Mysql - 1ére partieCours php & Mysql - 1ére partie
Cours php & Mysql - 1ére partie
 

More from julien pauli

Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019julien pauli
 
PHP 7 OPCache extension review
PHP 7 OPCache extension reviewPHP 7 OPCache extension review
PHP 7 OPCache extension reviewjulien pauli
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machinejulien pauli
 
Basics of Cryptography - Stream ciphers and PRNG
Basics of Cryptography - Stream ciphers and PRNGBasics of Cryptography - Stream ciphers and PRNG
Basics of Cryptography - Stream ciphers and PRNGjulien pauli
 
Mastering your home network - Do It Yourself
Mastering your home network - Do It YourselfMastering your home network - Do It Yourself
Mastering your home network - Do It Yourselfjulien pauli
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesjulien pauli
 
Php and threads ZTS
Php and threads ZTSPhp and threads ZTS
Php and threads ZTSjulien pauli
 
Symfony live 2017_php7_performances
Symfony live 2017_php7_performancesSymfony live 2017_php7_performances
Symfony live 2017_php7_performancesjulien pauli
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshopjulien pauli
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7julien pauli
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5julien pauli
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionjulien pauli
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshopjulien pauli
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objectsjulien pauli
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13julien pauli
 

More from julien pauli (20)

Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019
 
Php engine
Php enginePhp engine
Php engine
 
PHP 7 OPCache extension review
PHP 7 OPCache extension reviewPHP 7 OPCache extension review
PHP 7 OPCache extension review
 
Dns
DnsDns
Dns
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
 
Basics of Cryptography - Stream ciphers and PRNG
Basics of Cryptography - Stream ciphers and PRNGBasics of Cryptography - Stream ciphers and PRNG
Basics of Cryptography - Stream ciphers and PRNG
 
Mastering your home network - Do It Yourself
Mastering your home network - Do It YourselfMastering your home network - Do It Yourself
Mastering your home network - Do It Yourself
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performances
 
Php and threads ZTS
Php and threads ZTSPhp and threads ZTS
Php and threads ZTS
 
Tcpip
TcpipTcpip
Tcpip
 
Symfony live 2017_php7_performances
Symfony live 2017_php7_performancesSymfony live 2017_php7_performances
Symfony live 2017_php7_performances
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 

Migration PHP4-PHP5