Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43781 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90143 invoked from network); 26 Apr 2009 23:13:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2009 23:13:52 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.172 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.220.172 mail-fx0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:43862] helo=mail-fx0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/9F-00271-EAAE4F94 for ; Sun, 26 Apr 2009 19:13:51 -0400 Received: by fxm20 with SMTP id 20so2012143fxm.23 for ; Sun, 26 Apr 2009 16:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=v6h9KnY3zZFlld6tS8xNAUJhFRldR5eH7XOMKHc/UGw=; b=aAjhO79E4VQ+CmIE/vBwst/CRx6EjP4URa8DCkGHMv4kcR8WJVDe7whsVSO1VYFK7t eqGpEzRkAnUsy9E6md5vbBbmzw7+OxZQKIG1/GBCkjVzK1oLIzPMF9gM6j0RnzW1tsHf Ny6JtrPBsKcjOJSBJs/P2fVeb5FMKdCOdANKs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=jY/AT4E0hmjeD7azrymXytJ/j8ulhQvO7RQPLKLB+GIWmsQvV9Co01zjUfza6Z2IIy HzlAjlVSXbtJMx+NK6SQlwXBG463c8BArFy28LK3HsucxYXngO2Hr5VbzBsWXfi/dq8j j1XWEruNoDlm970rz/PrQKhoB+TtiUhIuUR+4= MIME-Version: 1.0 Sender: ekneuss@gmail.com Received: by 10.86.59.2 with SMTP id h2mr2723702fga.73.1240787626339; Sun, 26 Apr 2009 16:13:46 -0700 (PDT) In-Reply-To: <771f697e0904261428s678548a4w14a8270e8ecb4ceb@mail.gmail.com> References: <771f697e0904261428s678548a4w14a8270e8ecb4ceb@mail.gmail.com> Date: Mon, 27 Apr 2009 01:13:46 +0200 X-Google-Sender-Auth: a023e4a06b776145 Message-ID: To: Pablo Fischer Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] get_called_class returns empty on spl_autoload* From: webmaster@colder.ch (Etienne Kneuss) Hello, On Sun, Apr 26, 2009 at 11:28 PM, Pablo Fischer wrote: > Hello, > > Was playing with get_called_class inside an autoload method that is > registered via spl_autoload_register and noticed: > > =A0- If I use get_called_class inside an autoload method I get an empty > value from it > =A0- However the same doesn't happen if I'm not using a registered autolo= ad method > > Was wondering if this is a bug, a feature or something I'm just missing := -) > > The code I'm using is: > > class Loader { > =A0 =A0public static function autoload($className) > =A0 =A0{ > =A0 =A0 =A0 =A0var_dump('Calling ' . get_called_class() . ' for ' . $clas= sName); > =A0 =A0} > =A0 =A0public static function getCalledClass() > =A0 =A0{ > =A0 =A0 =A0 =A0var_dump('Current class is: ' . get_called_class()); > =A0 =A0} > } > > spl_autoload_register(array('Loader', 'autoload')); > Loader::getCalledClass(); > $foo =3D new Foo; > > And I get: > string(24) "Current class is: Loader" > string(16) "Calling =A0for Foo" > Fatal error: Class 'Foo' not found in > /Users/pablo/Projects/reptilia/test.php on line 17 > I can't reproduce, can you check with latest 5_3 ? Thanks in advance. > Thanks! > -- > Pablo Fischer (pablo [arroba/at] pablo.com.mx) > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal