Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5814 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89085 invoked by uid 1010); 30 Nov 2003 09:45:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88980 invoked from network); 30 Nov 2003 09:45:44 -0000 Received: from unknown (HELO smtprelay02.ispgateway.de) (62.67.200.157) by pb1.pair.com with SMTP; 30 Nov 2003 09:45:44 -0000 Received: (qmail 28670 invoked from network); 30 Nov 2003 09:45:43 -0000 Received: from unknown (HELO heinz-ruediger) (126482@[212.202.104.234]) (envelope-sender ) by smtprelay02.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 30 Nov 2003 09:45:43 -0000 To: internals@lists.php.net Date: Sun, 30 Nov 2003 10:42:20 +0100 MIME-Version: 1.0 Message-ID: <3FC9C98C.1182.31C2AB@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Subject: Naming convention for build-in classes and interfaces From: fb@fbeyer.com ("Ferdinand Beyer") Hello everyone, I think we have reached a point where we should really consider a naming convention for build-in classes and interfaces. In my opinion, popular class names like "exception", "iterator" or "directory" should be left to user land. Moreover we should make more use of interfaces for magical OO behavior like cloning, casting, serializing and overloading. Therefore my suggestion is to introduce following symbols: - class php_object instead of stdclass, since (object) $var represents an object and not a class. It is more meaningfull to create a new php_object() instead a new stdclass() - class php_exception instead of exception - interface php_cloneable for classes implementing the __clone() method - interface php_serializeable for classes implementing __sleep() and __wakeup() - interface php_overloadable for classes implementing __get(), __set() and __call() Maybe there is a better prefix than "php" to strictly separate Zend Engine from PHP. Examples are "zend_xxx", "zxxx" or "__xxx". -- Ferdinand Beyer