Upgrading from PHP 5.3 to 5.5

Upgrading from PHP 5.3 to 5.5

A small talk on the experiences gained from migrating from PHP 5.3 to 5.5.

02cd14759ba3327f68f737131947781f?s=128

Glen Mailer

October 05, 2013
Tweet

Transcript

  1. 1.
  2. 11.
  3. 18.
  4. 19.

    Upgrade a dev box
 Support 5.3 and 5.5
 Pass all

    tests
 Upgrade 1 Test env
 Upgrade CI
 Upgrade Test & Staging
 Incrementally Upgrade Live
  5. 25.

    Check for new function, fall back to old one if

    (function_exists('opcache_reset')) { opcache_reset(); } else { apc_clear_cache(); }
  6. 26.

    “The PHP api will retain compatibility with APC, as will

    common configuration options, providing a drop in replacement.” APCu
  7. 33.

    Type-checked function function inc($int) { if (!is_int($int)) { throw new

    InvalidArgumentException( 'Expected int, got: ' . $int ); } return $int + 1; }
  8. 34.

    Unit test for type-checked function /** * @dataprovider provideIncInvalid */

    function testIncRejectsInvalid($a) { try { inc($a); $this->fail('Expected exception'); } catch (InvalidArgumentException $ex) {} } function provideIncInvalid() { return array( null, true, "string", array() ); }
  9. 38.
  10. 39.

    Upgrade a dev box
 Support 5.3 and 5.5
 Pass all

    tests
 Upgrade 1 Test env
 Upgrade CI
 Upgrade Test & Staging
 Incrementally Upgrade Live
  11. 40.

    Upgrade a dev box
 Support 5.3 and 5.5
 Pass all

    tests
 Upgrade 1 Test env
 Upgrade CI
 Upgrade Test & Staging
 Incrementally Upgrade Live
  12. 41.
  13. 47.