From 115607076ab3319800d37f2f16b38811bc10c4b8 Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Mon, 20 Aug 2001 15:54:40 +0000 Subject: [PATCH] Class names start with an uppercased letters... git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55567 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop.xml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/language/oop.xml b/language/oop.xml index a0abd49608..31fec773b9 100644 --- a/language/oop.xml +++ b/language/oop.xml @@ -1,5 +1,5 @@ - + Classes and Objects @@ -504,7 +504,7 @@ $b->example(); You may find yourself writing code that refers to variables and functions in base classes. This is - particularly &true; if your derived class is a refinement + particularly true if your derived class is a refinement or specialisation of code in your base class. @@ -534,7 +534,7 @@ class B extends A { function example() { - echo "I am B::example and provide additional functionality().<br>\n"; + echo "I am B::example() and provide additional functionality.<br>\n"; parent::example(); } } @@ -617,9 +617,9 @@ page2.php: include("classa.inc"); $s = implode("", @file("store")); - unserialize($s); + $a = unserialize($s); - // now use the function show_one of the $a object. + // now use the function show_one() of the $a object. $a->show_one(); @@ -695,9 +695,9 @@ page2.php: -class foo +class Foo { - function foo($name) + function Foo($name) { // create a reference inside the global array $globalref global $globalref; @@ -732,7 +732,7 @@ class foo -$bar1 = new foo('set in constructor'); +$bar1 = new Foo('set in constructor'); $bar1->echoName(); $globalref[0]->echoName(); @@ -806,18 +806,18 @@ set from outside */ -class a +class A { - function a($i) + function A($i) { $this->value = $i; // try to figure out why we do not need a reference here - $this->b = new b($this); + $this->b = new B($this); } function createRef() { - $this->c = new b($this); + $this->c = new B($this); } function echoValue() @@ -827,9 +827,9 @@ class a } -class b +class B { - function b(&$a) + function B(&$a) { $this->a = &$a; } @@ -842,7 +842,7 @@ class b // try to undestand why using a simple copy here would yield // in an undesired result in the *-marked line -$a =& new a(10); +$a =& new A(10); $a->createRef(); $a->echoValue(); @@ -857,12 +857,12 @@ $a->c->echoValue(); /* output: -class a: 10 -class b: 10 -class b: 10 -class a: 11 -class b: 11 -class b: 11 +class A: 10 +class B: 10 +class B: 10 +class A: 11 +class B: 11 +class B: 11 */