diff --git a/language/oop.xml b/language/oop.xml index ead15ed93e..5e794bd27e 100644 --- a/language/oop.xml +++ b/language/oop.xml @@ -1,5 +1,5 @@ - + Classes and Objects @@ -161,7 +161,7 @@ $cart->items = array("10" => 1); $cart->$items = array("10" => 1); // correct, but may or may not be what was intended: -// $cart->$myvar becomes $ncart->items +// $cart->$myvar becomes $cart->items $myvar = 'items'; $cart->$myvar = array("10" => 1); @@ -190,7 +190,7 @@ $cart->$myvar = array("10" => 1); to another existing class. In fact, it is good practice to define a generic class which can be used in all your projects and adapt this class for the needs of each of your - specific projects. To facilitate this, Classes can be + specific projects. To facilitate this, classes can be extensions of other classes. The extended or derived class has all variables and functions of the base class (this is called 'inheritance' despite the fact that nobody died) and what @@ -407,7 +407,7 @@ $b = new B; Destructors are functions that are called automatically - when a variable is destroyed, either with unset + when an object is destroyed, either with unset or by simply going out of scope. There are no destructors in PHP.