Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 9272

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>New features</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration53.incompatible.html">Backward Incompatible Changes</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migration53.windows.html">Changes made to Windows support</a></div>
 <div class="up"><a href="migration53.html">Migrating from PHP 5.2.x to PHP 5.3.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="migration53.new-features" class="section">
  <h2 class="title">New features</h2>
  <p class="simpara">
   PHP 5.3.0 offers a wide range of new features:
  </p>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     Support for <a href="language.namespaces.html" class="link">namespaces</a> has been 
     added.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     Support for <a href="language.oop5.late-static-bindings.html" class="link">Late Static
     Bindings</a> has been added.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     Support for <a href="control-structures.goto.html" class="link">jump labels</a>
     (limited goto) has been added.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     Support for native <a href="functions.anonymous.html" class="link">Closures</a> 
     (Lambda/Anonymous functions) has been added.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     There are two new magic methods,
     <a href="language.oop5.overloading.html#object.callstatic" class="link">__callStatic()</a> and 
     <a href="language.oop5.magic.html#object.invoke" class="link">__invoke()</a>.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="language.types.string.html#language.types.string.syntax.nowdoc" class="link">Nowdoc</a> syntax is
     now supported, similar to
     <a href="language.types.string.html#language.types.string.syntax.heredoc" class="link">Heredoc</a> syntax,
     but with single quotes.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     It is now possible to use
     <a href="language.types.string.html#language.types.string.syntax.heredoc" class="link">Heredoc</a>s to
     initialize static variables and class properties/constants.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="language.types.string.html#language.types.string.syntax.heredoc" class="link">Heredoc</a>s may
     now be declared using double quotes, complementing the
     <a href="language.types.string.html#language.types.string.syntax.nowdoc" class="link">Nowdoc</a> syntax.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="language.constants.syntax.html" class="link">Constants</a> can now be
     declared outside a class using the <em>const</em> keyword.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     The <a href="language.operators.comparison.html#language.operators.comparison.ternary" class="link">ternary</a>
     operator now has a shorthand form: <em>?:</em>.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     The HTTP stream wrapper now considers all status codes from 200 to 399 to
     be successful.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     Dynamic access to static methods is now possible:
    </span>
    <div class="informalexample">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">C&nbsp;</span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;</span><span style="color: #0000BB">$foo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">123</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"C"</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #007700">::</span><span style="color: #0000BB">$foo</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

     <p class="para">The above example will output:</p>
     <div class="example-contents screen">
<div class="cdata"><pre>
123
</pre></div>
     </div>
    </div>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="language.exceptions.html" class="link">Exceptions</a> can now be nested:
    </span>
    <div class="informalexample">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">MyCustomException&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Exception&nbsp;</span><span style="color: #007700">{}<br /><br />try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">MyCustomException</span><span style="color: #007700">(</span><span style="color: #DD0000">"Exceptional"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">112</span><span style="color: #007700">);<br />}&nbsp;catch&nbsp;(</span><span style="color: #0000BB">Exception&nbsp;$e</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Note&nbsp;the&nbsp;use&nbsp;of&nbsp;the&nbsp;third&nbsp;parameter&nbsp;to&nbsp;pass&nbsp;$e<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;into&nbsp;the&nbsp;RuntimeException.&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">throw&nbsp;new&nbsp;</span><span style="color: #0000BB">RuntimeException</span><span style="color: #007700">(</span><span style="color: #DD0000">"Rethrowing"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">911</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$e</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

    </div>
   </li>
   <li class="listitem">
    <span class="simpara">
     A <a href="features.gc.html" class="link">garbage collector</a> for circular
     references has been added, and is enabled by default.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     The  <span class="function"><a href="function.mail.html" class="function">mail()</a></span> function now supports logging of sent email
     via the <a href="mail.configuration.html#ini.mail.log" class="link">mail.log</a> configuration
     directive. (Note: This only applies to email sent through this function.)
    </span>
   </li>
  </ul>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration53.incompatible.html">Backward Incompatible Changes</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migration53.windows.html">Changes made to Windows support</a></div>
 <div class="up"><a href="migration53.html">Migrating from PHP 5.2.x to PHP 5.3.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>