Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51521 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89776 invoked from network); 23 Feb 2011 18:48:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2011 18:48:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 178.77.98.152 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 178.77.98.152 lvps178-77-98-152.dedicated.hosteurope.de Linux 2.6 Received: from [178.77.98.152] ([178.77.98.152:35558] helo=beberlei.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/20-23187-D76556D4 for ; Wed, 23 Feb 2011 13:48:30 -0500 Received: from benny-pc (koln-4d0b15b5.pool.mediaWays.net [77.11.21.181]) by beberlei.de (Postfix) with ESMTPSA id 6C1A86E09019 for ; Wed, 23 Feb 2011 19:48:26 +0100 (CET) Date: Wed, 23 Feb 2011 19:48:18 +0100 To: internals@lists.php.net Message-ID: <20110223194818.7368c7a3@benny-pc> In-Reply-To: References: X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] get_class inconsistency From: kontakt@beberlei.de (Benjamin Eberlei) No, this wouldnt be backwards compatible to the PHP 5.2 behavior, hence inconsistent. The convention is class names in strings are ALWAYS fully qualified, therefore the prefix backslash is not necessary. On Wed, 23 Feb 2011 15:14:45 -0300 Martin Scotta wrote: > Hi all, > > would it be safer that get_class return the fully qualified class name ? > > namespace A\B\C { > class Test { } > echo get_class( new Test ); // it prints A\B\C\Test > }; > > It should print \A\B\C\Test, as explained > http://php.net/manual/en/language.namespaces.rules.php > > Martin Scotta