Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28678 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49858 invoked by uid 1010); 5 Apr 2007 03:32:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49843 invoked from network); 5 Apr 2007 03:32:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2007 03:32:11 -0000 Authentication-Results: pb1.pair.com header.from=diogin@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=diogin@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.250 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: diogin@gmail.com X-Host-Fingerprint: 209.85.132.250 an-out-0708.google.com Received: from [209.85.132.250] ([209.85.132.250:11303] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/6A-27269-ABD64164 for ; Wed, 04 Apr 2007 23:32:11 -0400 Received: by an-out-0708.google.com with SMTP id c28so563199ana for ; Wed, 04 Apr 2007 20:32:08 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=NVNF0b3FuSq7jY5W1LC6bl/cfS1rNg4ekKq5f0EmAOcaXnl/f/eKTCZemMFL17FyXjQK2o3Vrv9dtCN+8R0vC1hIbQ1JicfzMvscB9Nqx+9pwABKUZfTlTgCukVvN6eJu9QTkbsBAfyiEhrL6TSJd4U4SY4SDOhINFEOWwFEJaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=NJUso3ZtLzPb/yWAkOxjwQZ8KiSXNfQbG/o2g6JFypaofuqmvn6ckRE364+JmVcJfi92SCIfiheluw1fQ8D76Hao9MKZgT0akK1r3UeoOjaGTox14CipSDbBQiC1ht7oXgybRvt+mgsAAY5xZg78HWLpW5uXj59jp+fSPKLxKx0= Received: by 10.100.42.7 with SMTP id p7mr1003413anp.1175743927198; Wed, 04 Apr 2007 20:32:07 -0700 (PDT) Received: by 10.100.164.3 with HTTP; Wed, 4 Apr 2007 20:32:06 -0700 (PDT) Message-ID: Date: Thu, 5 Apr 2007 11:32:06 +0800 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_41687_5634195.1175743926990" Subject: abstract static function From: diogin@gmail.com ("Jingcheng Zhang") ------=_Part_41687_5634195.1175743926990 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi internals, I used to use abstract static function prior to php 5.2, because when I consider static class as a singleton, I can use abstract static function to delay the implementation of some methods to the derived classes. This happens, for example, when I declare a parent dispatcher, and extend it into two classes - action dispatcher and ajax dispatcher - and declare them static as I want to keep them a singleton because they are just application models, not domain models: Unfortunately, since php 5.2, although it does still allow declaring static methods in an interface, it simply generates a message when declaring abstract static functions with error_reporting set to E_ALL | E_STRICT. PHP is a dynamic language, not static as C++ and Java. So, why not allow abstract static functions? It is also a good way to support singleton natively. Waiting for explanations. Thanks :) -- Best regards, Jingcheng Zhang Room 304, Dormitory 26 of Yuquan Campus, Zhejiang University P.R.China ------=_Part_41687_5634195.1175743926990--