Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62921 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89716 invoked from network); 9 Sep 2012 19:32:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2012 19:32:43 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brianofish@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: brianofish@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:51236] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/24-00296-5DEEC405 for ; Sun, 09 Sep 2012 15:32:38 -0400 Received: by eekb15 with SMTP id b15so611501eek.29 for ; Sun, 09 Sep 2012 12:32:32 -0700 (PDT) Received: by 10.205.122.147 with SMTP id gg19mr3291761bkc.73.1347219152664; Sun, 09 Sep 2012 12:32:32 -0700 (PDT) Received: from [192.168.178.32] ([213.135.15.139]) by mx.google.com with ESMTPS id fu8sm5627198bkc.5.2012.09.09.12.32.30 (version=SSLv3 cipher=OTHER); Sun, 09 Sep 2012 12:32:31 -0700 (PDT) To: Sherif Ramadan Cc: internals@lists.php.net In-Reply-To: References: <1347177097.6077.82.camel@lat17.home.bof.de> Content-Type: text/plain; charset="UTF-8" Date: Sun, 09 Sep 2012 21:32:28 +0200 Message-ID: <1347219148.6077.89.camel@lat17.home.bof.de> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] get_class_vars() returned information ORDER From: php@bof.de (Patrick Schaaf) Thanks Sherif and all, for your answers. So I will not rely on the order returned by get_class_vars (or get_class_methods), instead adding suitable code (actually roughly one additional line per class involved) to define my desired ordering by hand. If you're curious, the use case I was thinking of, arose when implementing a logfile message formatting class hierarchy, where subclasses represent individual logfiles with different pieces of information that might be added to the logfile lines, in addition to the base message - stuff like PHP_SELF, the calling user, memory usage etc. I implement each of these different pieces as a separate trait with a formatting function of a certain prefix, and imagined I could just use the order of "use" statements in my subclasses, or as a proxy the method order, to stably define the order in which the pieces will the show in the logfile represented by that subclass. Now, I add a static::$order array to each subclass, where I name the pieces again (in addition to the use statements). best regards Patrick