<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Backward Incompatible Changes</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="migration55.changes.html">What has changed in PHP 5.5.x</a></div> <div class="next" style="text-align: right; float: right;"><a href="migration55.new-features.html">New features</a></div> <div class="up"><a href="migration55.html">Migrating from PHP 5.4.x to PHP 5.5.x</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="migration55.incompatible" class="sect1"> <h2 class="title">Backward Incompatible Changes</h2> <p class="simpara"> Although most existing PHP 5 code should work without changes, please take note of some backward incompatible changes: </p> <div class="sect2" id="migration55.incompatible.windows"> <h3 class="title">Windows XP and 2003 support dropped</h3> <p class="para"> Support for Windows XP and 2003 has been dropped. Windows builds of PHP now require Windows Vista or newer. </p> </div> <div class="sect2" id="migration55.incompatible.case"> <h3 class="title">Case insensitivity no longer locale specific</h3> <p class="para"> All case insensitive matching for function, class and constant names is now performed in a locale independent manner according to ASCII rules. This improves support for languages using the Latin alphabet with unusual collating rules, such as Turkish and Azeri. </p> <p class="para"> This may cause issues for code that uses case insensitive matches for non-ASCII characters in multibyte character sets (including UTF-8), such as accented characters in many European languages. If you have a non-English, non-ASCII code base, then you will need to test that you are not inadvertently relying on this behaviour before deploying PHP 5.5 to production systems. </p> </div> <div class="sect2" id="migration55.incompatible.pack"> <h3 class="title"> <span class="function"><a href="function.pack.html" class="function">pack()</a></span> and <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> changes</h3> <p class="para"> Changes were made to <span class="function"><a href="function.pack.html" class="function">pack()</a></span> and <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> to make them more compatible with Perl: </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <span class="function"><a href="function.pack.html" class="function">pack()</a></span> now supports the "Z" format code, which behaves identically to "a". </span> </li> <li class="listitem"> <span class="simpara"> <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> now support the "Z" format code for NULL padded strings, and behaves as "a" did in previous versions: it will strip trailing NULL bytes. </span> </li> <li class="listitem"> <span class="simpara"> <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> now keeps trailing NULL bytes when the "a" format code is used. </span> </li> <li class="listitem"> <span class="simpara"> <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> now strips all trailing ASCII whitespace when the "A" format code is used. </span> </li> </ul> <p class="para"> Writing backward compatible code that uses the "a" format code with <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> requires the use of <span class="function"><a href="function.version-compare.html" class="function">version_compare()</a></span>, due to the backward compatibility break. </p> <p class="para"> For example: </p> <div class="informalexample"> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Old code:<br /></span><span style="color: #0000BB">$data </span><span style="color: #007700">= </span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #DD0000">'a5'</span><span style="color: #007700">, </span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// New code:<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">version_compare</span><span style="color: #007700">(</span><span style="color: #0000BB">PHP_VERSION</span><span style="color: #007700">, </span><span style="color: #DD0000">'5.5.0-dev'</span><span style="color: #007700">, </span><span style="color: #DD0000">'>='</span><span style="color: #007700">)) {<br /> </span><span style="color: #0000BB">$data </span><span style="color: #007700">= </span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #DD0000">'Z5'</span><span style="color: #007700">, </span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br />} else {<br /> </span><span style="color: #0000BB">$data </span><span style="color: #007700">= </span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #DD0000">'a5'</span><span style="color: #007700">, </span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </div> <div class="sect2" id="migration55.incompatible.self-parent-static"> <h3 class="title"><em>self</em>, <em>parent</em> and <em>static</em> are now always case insensitive</h3> <p class="para"> Prior to PHP 5.5, cases existed where the <a href="language.oop5.paamayim-nekudotayim.html" class="link">self</a>, <a href="language.oop5.paamayim-nekudotayim.html" class="link">parent</a>, and <a href="language.oop5.late-static-bindings.html" class="link">static</a> keywords were treated in a case sensitive fashion. These have now been resolved, and these keywords are always handled case insensitively: <em>SELF::CONSTANT</em> is now treated identically to <em>self::CONSTANT</em>. </p> </div> <div class="sect2" id="migration55.incompatible.guid"> <h3 class="title">PHP logo GUIDs removed</h3> <p class="para"> The GUIDs that previously resulted in PHP outputting various logos have been removed. This includes the removal of the functions to return those GUIDs. The removed functions are: </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <span class="function"><a href="function.php-logo-guid.html" class="function">php_logo_guid()</a></span> </span> </li> <li class="listitem"> <span class="simpara"> <span class="function"><strong>php_egg_logo_guid()</strong></span> </span> </li> <li class="listitem"> <span class="simpara"> <span class="function"><strong>php_real_logo_guid()</strong></span> </span> </li> <li class="listitem"> <span class="simpara"> <span class="function"><a href="function.zend-logo-guid.html" class="function">zend_logo_guid()</a></span> </span> </li> </ul> </div> <div class="sect2" id="migration55.incompatible.execution"> <h3 class="title">Internal execution changes</h3> <p class="para"> Extension authors should note that the <strong class="command">zend_execute()</strong> function can no longer be overridden, and that numerous changes have been made to the <em>execute_data</em> struct and related function and method handling opcodes. </p> <p class="para"> Most extension authors are unlikely to be affected, but those writing extensions that hook deeply into the Zend Engine should read <a href="migration55.internals.html" class="link">the notes on these changes</a>. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="migration55.changes.html">What has changed in PHP 5.5.x</a></div> <div class="next" style="text-align: right; float: right;"><a href="migration55.new-features.html">New features</a></div> <div class="up"><a href="migration55.html">Migrating from PHP 5.4.x to PHP 5.5.x</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>