From PHP4 to PHP5
                           Why you should migrate



 Ivo Jansch <ivo@ibuildings.nl>




               ...
Contents

 •   About me
 •   The end of life of PHP4
 •   The benefits of PHP5
 •   Product support
     The migration pro...
About me

 • CTO at Ibuildings
           PHP consultancy, development & support
       
           Netherlands and UK ba...
The end of life of PHP4
 • PHP.net official announcement
       PHP4 support is going to end in December 2007
       Onl...
Why migrate now?
 • You still have the time to migrate, on your own
   terms, with your own planning.

 • What if you don'...
Benefits of PHP5
 •   Performance
 •   Maintainability
 •   Robustness
 •   Ready for the future




 Tuesday 25 September...
Performance




 Benchmark done by Sebastian Bergmann. Full article at:
 http://sebastian-bergmann.de/archives/634-PHP-GCC...
Maintainability
 • A new object model
       Abstract classes
       Interfaces
       Encapsulation (private, public, ...
Robustness
 • Exception Handling
       Problematic situations handled gracefully
       Error handling not only part of...
Ready for the future
 • “Web 2.0”
       Web Services
       RSS (XML)
       Ajax
       Mashups




 • PHP has core ...
Ready for the future
 • Web Services (SOAP)


       Client is as easy as:
         $ws = new SoapClient(“http://someweat...
Ready for the future
 • XML
       1 line of code to parse XML
       OO access to the contents

            $xmldata = ...
Product support

 • Zend Framework
        PHP5 framework
        Use at Will architecture
        http://framework.zen...
The Migration Process

 2 phases:

 • Compatibility migration
        Make things work
        End-of-life reasons
     ...
Compatibility Migration

 • Take into account:
        The new object model
        Name clashes
        Some backwards...
Compatibility Migration

 • Process:

        Run unit tests (if you have them)
        Do manual tests
        Fix wha...
Code Migration

 • Take advantage of PHP5 features
        Revise your architecture (OO)
        Implement Exception Han...
Important
 • Take Migration seriously
       Create a planning
       Don't wait until 8-8-8
       Take time for testi...
Questions?



Use the Q&A box (the one with the '?' icon)




                                              Ibuildings.nl BV
More info


 • Visit these websites for more information:

           http://www.php.net
       
           http://www.ze...
Upcoming SlideShare
Loading in...5
×

Migrating from PHP4 To PHP5 - Zend Webinar

2,693

Published on

Webinar about migrating from php4 to php5. Hosted by Zend.

Published in: Business, Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,693
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Migrating from PHP4 To PHP5 - Zend Webinar"

  1. 1. From PHP4 to PHP5 Why you should migrate Ivo Jansch <ivo@ibuildings.nl> Ibuildings.nl BV
  2. 2. Contents • About me • The end of life of PHP4 • The benefits of PHP5 • Product support The migration process • • Q&A Tuesday 25 September 2007 2
  3. 3. About me • CTO at Ibuildings PHP consultancy, development & support  Netherlands and UK based  Official representative of Zend  http://www.achievo.org/blog  http://www.ibuildings.nl  • Geek  Author of several open source projects  Interested in Internet, Web 2.0, PHP Tuesday 25 September 2007 3
  4. 4. The end of life of PHP4 • PHP.net official announcement  PHP4 support is going to end in December 2007  Only critical security fixes until 8-8-8  No support for PHP4 after 8-8-8! • Gophp5.org  Community effort to migrate projects to PHP5  No releases for PHP4 after February 5th, 2008  Supported by major projects such as Drupal, Gallery, PEAR, phpMyAdmin, Symfony and Typo3 Tuesday 25 September 2007 4
  5. 5. Why migrate now? • You still have the time to migrate, on your own terms, with your own planning. • What if you don't migrate? • Doom scenario: major security bug discovered in PHP4 after 8-8-8  Only solution: migrate  Migration done under stress...  Rush job...  Badly tested... Tuesday 25 September 2007 5
  6. 6. Benefits of PHP5 • Performance • Maintainability • Robustness • Ready for the future Tuesday 25 September 2007 6
  7. 7. Performance Benchmark done by Sebastian Bergmann. Full article at: http://sebastian-bergmann.de/archives/634-PHP-GCC-ICC-Benchmark.html Tuesday 25 September 2007 7
  8. 8. Maintainability • A new object model  Abstract classes  Interfaces  Encapsulation (private, public, protected) • SPL • Easier to apply proper architecture  Cleaner codebase  Easier to read  Simpler to maintain Tuesday 25 September 2007 8
  9. 9. Robustness • Exception Handling  Problematic situations handled gracefully  Error handling not only part of code, but also of design try { // regular code } catch (Exception e) { // What to do in case of an error }  Cleaner code -> increased productivity & more robust Tuesday 25 September 2007 9
  10. 10. Ready for the future • “Web 2.0”  Web Services  RSS (XML)  Ajax  Mashups • PHP has core functionality to support all of this Tuesday 25 September 2007 10
  11. 11. Ready for the future • Web Services (SOAP)  Client is as easy as: $ws = new SoapClient(“http://someweatherservice.com/?WSDL”); $weather = $ws->getWeather(“Amsterdam”);  Server is as easy as: $server = new SoapServer(“calculator.wsdl”); $server->setObject(new myCalculator()); $server->handle(); • How many lines did that take in PHP4? Tuesday 25 September 2007 11
  12. 12. Ready for the future • XML  1 line of code to parse XML  OO access to the contents $xmldata = simplexml_load_file(quot;products.xmlquot;); foreach($xmldata->products as $product) { echo $product->manufacturer->name; } Tuesday 25 September 2007 12
  13. 13. Product support • Zend Framework  PHP5 framework  Use at Will architecture  http://framework.zend.com • Zend Core  Maintaining your PHP infrastucture  Keep track of updates  Get support • Many third party tools Tuesday 25 September 2007 13
  14. 14. The Migration Process 2 phases: • Compatibility migration  Make things work  End-of-life reasons  Performance benefits • Code migration  Make use of new PHP5 functionality  All the other benefits Tuesday 25 September 2007 14
  15. 15. Compatibility Migration • Take into account:  The new object model  Name clashes  Some backwards incompatibilities  Compatibility with new default settings • Guidelines:  http://www.php.net/manual/en/migration5.php Tuesday 25 September 2007 15
  16. 16. Compatibility Migration • Process:  Run unit tests (if you have them)  Do manual tests  Fix what you find  Repeat • Important: change as little as possible Tuesday 25 September 2007 16
  17. 17. Code Migration • Take advantage of PHP5 features  Revise your architecture (OO)  Implement Exception Handling  Replace legacy code with PHP5 functionality • You don't have to do this overnight  Incremental changes  Not all features at once  Refactor  Weigh benefits and costs Tuesday 25 September 2007 17
  18. 18. Important • Take Migration seriously  Create a planning  Don't wait until 8-8-8  Take time for testing • Get help  Zend has migration services  Use the documentation  Ask the community  Consider training Tuesday 25 September 2007 18
  19. 19. Questions? Use the Q&A box (the one with the '?' icon) Ibuildings.nl BV
  20. 20. More info • Visit these websites for more information: http://www.php.net  http://www.zend.com  http://www.php.net/manual/en/migration5.php  http://www.gophp5.org  http://www.achievo.org/blog  • ivo@ibuildings.nl • Thank you! Tuesday 25 September 2007 20

×