Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 9233

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 Object Model</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration5.databases.html">Databases</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migrating5.errorrep.html">Error Reporting</a></div>
 <div class="up"><a href="migration5.html">Migrating from PHP 4 to PHP 5.0.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="migration5.oop" class="section">
   <h2 class="title">New Object Model</h2>
   <p class="para">
    In PHP 5 there is a new Object Model. PHP&#039;s handling of objects has been
    completely rewritten, allowing for better performance and more features.
    In previous versions of PHP, objects were handled like primitive types
    (for instance integers and strings). The drawback of this method was that
    semantically the whole object was copied when a variable was assigned, or
    passed as a parameter to a method. In the new approach, objects are
    referenced by handle, and not by value (one can think of a handle as an
    object&#039;s identifier).
   </p>
   <p class="para">
    Many PHP programmers aren&#039;t even aware of the copying quirks of the old
    object model and, therefore, the majority of PHP applications will work
    out of the box, or with very few modifications.
   </p>
   <p class="para">
    The new Object Model is documented at the <a href="language.oop5.html" class="link">Language Reference</a>.
   </p>
   <p class="para">
    In PHP 5, function with the name of a class is called as a constructor
    only if defined in the same class. In PHP 4, it is called also if defined
    in the parent class.
   </p>
   <p class="para">
    See also the <a href="ini.core.html#ini.zend.ze1-compatibility-mode" class="link">
    zend.ze1_compatibility_mode</a> directive for compatability with 
    PHP 4. 
   </p>
  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration5.databases.html">Databases</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migrating5.errorrep.html">Error Reporting</a></div>
 <div class="up"><a href="migration5.html">Migrating from PHP 4 to PHP 5.0.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>