Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43193 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79994 invoked from network); 26 Feb 2009 21:43:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2009 21:43:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=stuttle@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stuttle@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: stuttle@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-gx0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:50361] helo=mail-gx0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/77-30584-31D07A94 for ; Thu, 26 Feb 2009 16:43:49 -0500 Received: by gxk26 with SMTP id 26so1738907gxk.23 for ; Thu, 26 Feb 2009 13:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=OVOvI6ZfksJDRW6WSX+GjvOIhsN9KPpfFuZxfoC1EBc=; b=l7wzwNsdONq+UubWyQW1sa81gs8EcKeUWmmltij99cEqZoFMcnLgC0yYoyD3IJ/lGb Pj1I1XOPuGHDZ7WRUVoFBmfeShWSvg8xOoUhomyKbCLPkxkfaHj0o6taK2k31K35qdHs 8Qs9gsA5nFzVOnZuQPsPUk5DER7NKi+LYZNgY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=MYHasG0ModEaZsBmZmjDPvMazLx/1MDlhlXml7UUxOQi+qdCez72R3ytLXVjfYV3Yb LAgkG6a4DNer0URXhOXsaFjkg6+syQDT0x6UZlTeJ7+OX8Nr6d+kip1NPYMxDVXL8AId EMFLMjO+9gTgK2L0K1ufXvMwPaR9U/IhgLf/g= MIME-Version: 1.0 Received: by 10.143.3.4 with SMTP id f4mr856091wfi.299.1235684623969; Thu, 26 Feb 2009 13:43:43 -0800 (PST) In-Reply-To: References: Date: Thu, 26 Feb 2009 21:43:43 +0000 Message-ID: To: viroteck@viroteck.net Cc: internals Mailing List Content-Type: multipart/alternative; boundary=001636e90cd810ef460463d93fd0 Subject: Re: [PHP-DEV] Class names (with regard to autoload) From: stuttle@gmail.com (Stuart) --001636e90cd810ef460463d93fd0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 2009/2/26 Robin Burchell > Hi all, > > I've been playing around with autoload lately, and specifically using > autoload to load classes which may be in subdirectories. I came up > with the following test script: > > > function __autoload($sName) > { > echo "autoloading " . $sName . "\n"; > } > > $s = "Foo.Bar"; > > $a = new $s(); > $b = new Foo.Bar(); > ?> > > The first line demonstrates what I'm after ("autoloading Foo.Bar"), > and the second seems to give a bit of an odd/incorrect (in these > circumstances) result(__autoload is invoked with "Foo"). > > Is it possible to reconcile this behaviour to be a bit more > consistant, and provide the behaviour I'm after? > > I'm willing to try provide a patch, if someone would be kind enough to > direct me to the part(s) of the engine I'd need to look at. > The concatenation operator (.) is not valid in a class name. Use an underscore and you'll be able to get the behaviour you want. -Stuart -- http://stut.net/ --001636e90cd810ef460463d93fd0--