Some rewording, and proto definitions

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@165712 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Curt Zirzow 2004-08-08 00:59:54 +00:00
parent 8abd96e10d
commit c5601b0487

View file

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<sect1 id="language.oop5.decon">
<title>Constructors and Destructors</title>
<sect2 id="oop5-decon-constructor">
<title>Constructor</title>
<methodsynopsis>
<type>void</type><methodname>__construct</methodname>
<methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam>
<methodparam choice="opt"><parameter>...</parameter></methodparam>
</methodsynopsis>
<para>
PHP 5 allows developers to declare constructor methods for classes.
Classes which have a constructor method call this method on each
@ -52,14 +57,17 @@ $obj = new SubClass();
</para>
</sect2>
<sect2 id="oop5-decon-destructor">
<title>Destructor</title>
<methodsynopsis>
<type>void</type><methodname>__destruct</methodname>
</methodsynopsis>
<para>
PHP 5 introduces a destructor concept similar to that of other
object-oriented languages, such as Java: When the last reference to an
object is destroyed the object's destructor, which is a class method
named <function>__destruct</function> that receives no parameters, is
called before the object is freed from memory.
object-oriented languages, such as Java. The destructor method will be
called as soon as all references to a paticular object are removed or when
the object is explicitly destroyed.
</para>
<example>
<title>Destructor Example</title>