Please use 4 (four!) spaces for identation, many, many

WS ONLY FIXES.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55533 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gabor Hojtsy 2001-08-20 13:37:41 +00:00
parent 65f1991d61
commit 57e995fbd9

View file

@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
<!-- $Revision: 1.23 $ -->
<!-- $Revision: 1.24 $ -->
<chapter id="language.oop">
<title>Classes and Objects</title>
@ -310,18 +310,18 @@ $different_cart = new Constructor_Cart("20", 17);
<programlisting role="php">
class A
{
function A()
{
echo "I am the constructor of A.&lt;br>\n";
}
function A()
{
echo "I am the constructor of A.&lt;br>\n";
}
}
class B extends A
{
function C()
{
echo "I am a regular function.&lt;br>\n";
}
function C()
{
echo "I am a regular function.&lt;br>\n";
}
}
// no constructor is being called in PHP 3.
@ -347,24 +347,24 @@ $b = new B;
<programlisting role="php">
class A
{
function A()
{
echo "I am the constructor of A.&lt;br>\n";
}
function B()
{
echo "I am a regular function named B in class A.&lt;br>\n";
echo "I am not a constructor in A.&lt;br>\n";
}
function A()
{
echo "I am the constructor of A.&lt;br>\n";
}
function B()
{
echo "I am a regular function named B in class A.&lt;br>\n";
echo "I am not a constructor in A.&lt;br>\n";
}
}
class B extends A
{
function C()
{
echo "I am a regular function.&lt;br>\n";
}
function C()
{
echo "I am a regular function.&lt;br>\n";
}
}
// This will call B() as a constructor.
@ -433,19 +433,19 @@ $b = new B;
<programlisting role="php">
class A
{
function example()
{
echo "I am the original function A::example().&lt;br>\n";
}
function example()
{
echo "I am the original function A::example().&lt;br>\n";
}
}
class B extends A
{
function example()
{
echo "I am the redefined function B::example().&lt;br>\n";
A::example();
}
function example()
{
echo "I am the redefined function B::example().&lt;br>\n";
A::example();
}
}
// there is no object of class A.
@ -524,19 +524,19 @@ $b->example();
<programlisting role="php">
class A
{
function example()
{
echo "I am A::example() and provide basic functionality.&lt;br>\n";
}
function example()
{
echo "I am A::example() and provide basic functionality.&lt;br>\n";
}
}
class B extends A
{
function example()
{
echo "I am B::example and provide additional functionality().&lt;br>\n";
parent::example();
}
function example()
{
echo "I am B::example and provide additional functionality().&lt;br>\n";
parent::example();
}
}
$b = new B;
@ -594,12 +594,12 @@ $b->example();
classa.inc:
class A
{
var $one = 1;
var $one = 1;
function show_one()
{
echo $this->one;
}
function show_one()
{
echo $this->one;
}
}
page1.php:
@ -750,9 +750,9 @@ set in constructor
set in constructor
set in constructor */
</programlisting>
</informalexample>
</para>
</programlisting>
</informalexample>
</para>
<para>
Apparently there is no difference, but in fact there is a
very significant one: <varname>$bar1</varname> and