Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38475 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99774 invoked from network); 20 Jun 2008 16:15:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2008 16:15:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.170 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: 66.249.92.170 ug-out-1314.google.com Received: from [66.249.92.170] ([66.249.92.170:23244] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/10-31321-776DB584 for ; Fri, 20 Jun 2008 12:10:32 -0400 Received: by ug-out-1314.google.com with SMTP id h3so17772ugf.29 for ; Fri, 20 Jun 2008 09:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:mime-version:content-type:content-transfer-encoding :content-disposition:x-google-sender-auth; bh=Iw69yTVYHjpczSX16TDFe+2nS6r0+TXQniDtNmFrwas=; b=IUbHa5o5sL/rPnpnMy4RSTpbx3ya2B8SwqzcnojLAoFXE8aULcxetKRsubALwPcafU LB9UHaaw1KFicE8MGNDpY04mvNWAcX3q9Enmyfi6OV3yEnFmwQ0D9E1cYhzrXxATqTg4 gxm0gUnwmjpmLbXKdWfcRKg7tujFDDhWB9wkA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; b=M6F2feuKYmDl15pF92A+AUbfrR1yALagIk+WqWnOdkA8ue2oUfynLHHzTvk5lITQVe x091KiaB7/hiuA2r76iUdRCHcC/LWR05GG3rY7whI9lAFn3RRQ+9kz9zsGS3IFLdot4z kyR4buxbOWi2MeYNAiQoeihhsETP8l3WbJeIM= Received: by 10.210.18.18 with SMTP id 18mr3194643ebr.95.1213977853574; Fri, 20 Jun 2008 09:04:13 -0700 (PDT) Received: by 10.151.83.19 with HTTP; Fri, 20 Jun 2008 09:04:13 -0700 (PDT) Message-ID: Date: Fri, 20 Jun 2008 18:04:13 +0200 Sender: ekneuss@gmail.com To: "PHP internals" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 1e08b75f34e79770 Subject: LSB forward_static_call() From: colder@php.net ("Etienne Kneuss") Hi, Sorry to bring that up again! Quick summary for people that didn't follow it: LSB was implemented, and it was decided that "explicit calls" ( ClassName::method() ) wouldn't pass the caller info if no fallbacks occured. Some people that were looking forward to having LSB were disappointed as it meant that it wouldn't be possible to sanely overwrite a static method, without loosing info on the caller. Quick POC: class A { public static function test() { echo get_called_class(); }} class B extends A { public static function test() { echo get_called_class(); parent::test(); } class C extends B; C::test(); // will output CA To be able to pass information, it was decided to implement a call_user_func-like function that passed the caller info: forward_static_call(_array). Back then, I was for that solution, but with some time I realized that it would probably be one of those decisions that would bite us back afterward. To sum up key points about each possibilities: 1) forward_static_call + no need to affect the engine - slow, painful 2) parent:: carries the info while ParentClassName:: doesn't + convenient + no functionnality lost - introduces a difference between parent:: and classname::, but restricted to LSB so no BC break It really seems like (2) is the most PHP way of doing things, while (1) is more of a hack that we will regret later. The only problem about (2) is that difference, but I really feel (and experienced in the multiple help channels that I'm in) that people already see (wrongly for now) classname:: and parent:: as slightly different. So introducing it as of 5_3 wouldn't be too much of a shock. The point is that: people who uses LSB will be aware of that difference and will use parent:: vs classname:: carefully, while others will be able to ignore it So, I really would like to revert that foward_static_call stuff and implement the parent:: patch instead, while it's still possible. thoughts? -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal