From: Marcus Boerger Date: Sun, 1 Jun 2003 19:18:34 +0000 (+0000) Subject: No nested classes X-Git-Tag: RELEASE_1_0_2~467 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e2f7b06b5f668e5f1bfc428478bd2bfffb5e49f;p=php No nested classes --- diff --git a/Zend/tests/zend2.php b/Zend/tests/zend2.php index 100bdbec95..afe422eaae 100644 --- a/Zend/tests/zend2.php +++ b/Zend/tests/zend2.php @@ -67,71 +67,7 @@ Example 2: Factory method (derefencing objects returned from functions) ?> -Example 3: Nested class -======================= - -host' as $user\n"; - } - } - - class Oracle { - var $host = "localhost"; - - function db_connect($user) { - print "Connecting to Oracle database '$this->host' as $user\n"; - } - - } - } - - $MySQL_obj = new Database::MySQL(); - $MySQL_obj->db_connect("John"); - - $Oracle_obj = new Database::Oracle(); - $Oracle_obj->db_connect("Mark"); - - unset($MySQL_obj); - unset($Oracle_obj); -?> - -Example 3: Nested class suitable for a PEAR like hierarchy -========================================================== - -host' as $user\n"; - } - } - - class DB::Oracle { - var $host = "localhost"; - - function db_connect($user) { - print "Connecting to Oracle database '$this->host' as $user\n"; - } - - } - - $MySQL_obj = new DB::MySQL(); - $MySQL_obj->db_connect("Susan"); - - $Oracle_obj = new DB::Oracle(); - $Oracle_obj->db_connect("Barbara"); - -?> - -Example 4: Class constants and class scope +Example 3: Class constants and class scope ========================================== -Example 5: Regular object method using both local and global functions +Example 4: Regular object method using both local and global functions ====================================================================== -Example 6: Multiple derefencing of objects returned from methods +Example 5: Multiple derefencing of objects returned from methods ================================================================ -Example 7: Exception handling +Example 6: Exception handling ============================= -Example 8: __clone() +Example 7: __clone() =================== -Example 9: Unified constructors +Example 8: Unified constructors =============================== -Example 10: Destructors +Example 9: Destructors =======================