Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Symfony Blog:
Paving the way for Symfony 3 with the "Deprecation Detector" tool
Oct 22, 2015 @ 10:48:31

On the Symfony blog there's a post talking about a tool they've introduced that is helping to "pave the way" for the upcoming version 3 release of the Symfony framework - the Deprecation Detector tool.

Symfony 3 will be released at the end of November 2015. Learning from our own history, the transition from Symfony 2 to 3 will be much more pleasant than the transition from symfony 1 to 2 that happened in July 2011.

Technically speaking, Symfony 3 includes no new features comparing it with Symfony 2.8, which will be released at the same time. [...] This means that your Symfony applications won't work on Symfony 3 unless you remove all their deprecations. In order to simplify the task of finding which deprecations affect your applications, a new tool called Deprecation Detector has just been released.

The tool runs static analysis against your codebase and finds locations where you're using deprecated methods/classes/interfaces/etc and reports them back for fixing. The post includes the commands you'll need to get the tool installed and how to run it against your code. You can find out more about the project and get details on command line options on its GitHub repository.

tagged: deprecation detector symfony2 symfony3 method interface class service tool tutorial

Link: http://symfony.com/blog/paving-the-way-for-symfony-3-with-the-deprecation-detector-tool

Symfony Blog:
Twig: How to upgrade to 2.0? Deprecation Notices to the Rescue
Aug 19, 2015 @ 10:55:58

The Symfony blog has posted a quick guide with a tip to upgrading to Twig 2.0 made simpler thanks to some built-in deprecation notices.

As Twig 2.0 is approaching fast now, it's time to focus on how to boost adoption of this new major version. [...] Also, the good news is that most of the time, it's possible to make your code work for both major versions (that's important for shared code like bundles). [...] How to make it easy? Like for Symfony, I've now added deprecation notices throughout the code to give Twig users an easy way to upgrade their code (this is available in the upcoming Twig 1.21 version).

The release of v1.21 comes with the deprecation notices already built-in making it easy to find the issues before making the jump up to v2.0. He also includes mentions of two other things included to make it easier: a deprecation collector to gather the issues in one place and a visitor base class diff that can make them compatible with both versions (1.21 and pre-1.21).

tagged: twig2 twig templating version upgrade deprecation notice

Link: http://symfony.com/blog/twig-how-to-upgrade-to-2-0-deprecation-notices-to-the-rescue

PHP7 Migration Guide Posted
Aug 17, 2015 @ 11:29:48

The official PHP.net has posted their PHP 7 migration guide for those already on PHP 5.6.x and wanting to prepare their applications for PHP7.

Despite the fact that PHP 7.0 is a new major version, efforts were put in to make migration as painless as possible. This release focusses mainly on removing functionality deprecated in previous versions and improving language consistency. There are a few incompatibilities and new features that should be considered, and code should be tested before switching PHP versions in production environments.

The guide includes links to other pages showing things like:

  • Backward incompatible changes
  • New features
  • Deprecated features in PHP 7.0.x
  • New functions/classes/interfaces/global constants
  • Removed Extensions and SAPIs

There's also a link to some other various changes that's not completely fleshed out yet, but is evolving as PHP 7 gets closer to a final release.

tagged: php7 migration guide php56 changes update deprecation remove features

Link: http://php.net/manual/en/migration70.php

Safely Deprecating APIs
May 14, 2013 @ 13:09:17

On PHPMaster.com today there's an article with some good suggestions about ways to deprecate parts of an API safely.

Deprecation can happen for various reasons – perhaps an API is no longer useful and has reached its end-of-life, or the refactoring of code to improve its reusability and testability obsoletes particular methods. In this article I’ll share with you some key points that you should follow when deprecating APIs so you can continue to grow your code and provide fair warning to those who depend on it.

They break it up into a few different steps:

  • Prepare for Refactoring
  • Employ the Single Responsibility Principle
  • Communicate with your Users
  • Remove the Old Code
tagged: api deprecation method suggestion tutorial

Link: http://phpmaster.com/safely-deprecating-apis

Symfony Blog:
Symfony plugin deprecation
Jun 21, 2010 @ 12:36:53

The Symfony project has officially introduced something that can help with the future of your Symfony-related code/plugin - the ability to deprecate the plugin (via the plguin system) and let everyone using it know it's no longer in development.

There are several reasons why a plugin may be deprecated. The symfony core framework might have included the functionality of the plugin in a recent release, or another plugin with the same functionality might be doing a better job at it. Whatever the reason, a developer is now able to mark a plugin as deprecated. This is simply done in the administration panel of the plugin.

A message will pop up when the plugin is next used to let the developers of the site know the deprecation status of the plugin - complete with a custom message.

tagged: plugin deprecation symfony framework


IBM developerWorks:
What's new in PHP V5.3, Part 5: Upgrading from PHP V5.2
Feb 26, 2009 @ 11:14:56

On the IBM developerWorks blog the next article in their "What's new in PHP V5.3" series has been posted. In this fifth part looks at some of the changes and issues you might face when making the upgrade (including slightly modified function behavior and deprecated functions).

In this final part of the series, learn about things to consider when upgrading from PHP V5.2. There are changes that break backward-compatibility and features that are deprecated in PHP V5.3 for removal in future versions. Some enhancements to existing features within PHP are also covered.

Changes included in the list are:

  • Syntax changes
  • Changes to functions and methods
  • Extension changes
  • Build changes
  • Deprecated items
tagged: php5 upgrade change compatibility deprecation