Sugar Developer Blog

PHP 5.3 and your web application

18 Aug, 2009
Posted By: John Mertic

PHP LogoIt’s been almost two months now since PHP 5.3 has come on the scene, bringing not only many performance and stability improvements to the language, but also several new features that bring new capabilities to the language. The list of features added includes:

  • Namespaces are probably one of the most sought after and debated features in PHP history, this enables you to namespace your variables, functions, classes, and constants to avoid naming collisions of having everything defined in the global scope.
  • Closures are a feature that is popular in many functional languages as well as in Javascript, and allow you to define “throw-away” functions that are bound to a variable. The flexibility with this feature means you can pass functions as arguments to functions, defining these functions without having to worry about them needing to be in the global scope as well ( and in the process “throw” them away when they are no longer needed ).
  • Late Static Binding give you more options when subclassing static methods and properties, enabling developers to resolve class references at run-time rather than compile-time.
  • Circular garbage collection which will help memory usage in many complex objects ( we at Sugar are really excited about this ).
  • Better Windows support, including VC9 builds which offer better performance than the standard VC6 built binaries ( big benefits to anyone deploying on Windows here ).
  • Inclusion of the phar extension, which allows you to package an entire application inside an single file similar to JAR files in Java ( something else we are looking at here at Sugar ).

So with all these new features, it seems like moving to PHP 5.3 is a no brainer. The PHP project provides guides related to backwards incompatible changes and deprecated features for those upgrading from PHP 5.2, which cover most of things users upgrading their codebases to work with PHP 5.3 should look for as part of the migration. Here at Sugar we’re beginning internal testing on PHP 5.3 for future versions of SugarCRM, in the process making adjustments to the product as needed to ensure smooth sailing under the new version of PHP.

How many other developers have converted their applications to support PHP 5.3? Has it been easy, or have you had difficulty in readying you code? Sound off in the comments with your experiences.

2 Responses to “PHP 5.3 and your web application”

  1. Alex Says:

    Hi,

    we converted our Joomla based extension JoomFish to PHP 5.3 which was only a bigger deal as we needed to change a library which is outdated and not any longer supported. But other than that it worked easily.

    I know the next version of Joomla is also supporting PHP 5.3 in the next release (1.5.15) which was from what I saw also primarily a discussion about replacing libraries and other code that is no longer supported.

    Alex

  2. Alex Says:

    PS: Is there a way to help you with testing Sugar 5.5 on PHP 5.3? Some switch to allow the installer to run through on this version too?

Leave a Reply

Have feedback for us? Drop us a line.
Terms & Conditions | Privacy | Trademark Info | Contact Info | FAQs | SugarCRM Inc.© 2004 - 2009 All rights reserved.