downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/migration5.oop.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/migration5.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'migration5.oop.php',
   
1 => 'New Object Model',
  ),
 
'up' =>
  array (
   
0 => 'migration5.php',
   
1 => 'Migrating from PHP 4 to PHP 5.0.x',
  ),
 
'prev' =>
  array (
   
0 => 'migration5.databases.php',
   
1 => 'Databases',
  ),
 
'next' =>
  array (
   
0 => 'migrating5.errorrep.php',
   
1 => 'Error Reporting',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<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.php" 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.php#ini.zend.ze1-compatibility-mode" class="link">
    zend.ze1_compatibility_mode</a> directive for compatability with
    PHP 4.
   </p>
  </div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites