From bed4bd6c008244bc2b113485b66cc9806003e836 Mon Sep 17 00:00:00 2001 From: Markus Fischer Date: Mon, 10 Jun 2002 08:43:11 +0000 Subject: [PATCH] - Document that order of class definition is important (closes #13165). # Though the zend engine CAN handle class definitions not in the right order # this is not always true, especially when extending classes which extend # classes. See the report. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@85237 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/language/oop.xml b/language/oop.xml index b018e35831..2bfb9cbe9a 100644 --- a/language/oop.xml +++ b/language/oop.xml @@ -1,5 +1,5 @@ - + Classes and Objects @@ -255,6 +255,25 @@ $ncart->add_item("10", 1); // (inherited functionality from cart) + + This is also called a "parent-child" relationship. You create a class, + parent, and use extends to create a new class + based on the parent class: the child class. You can + even use this new child class and create another class based on this child + class. + + + + Classes must be defined before they are used! If you want the class + Named_Cart to extend the class + Cart, you will have to define the class + Cart first. If you want to create another class called + Yellow_named_cart based on the class + Named_Cart you have to define + Named_Cart first. To make it short: the order in which + the classes are defined is important. + +