Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79289 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80388 invoked from network); 28 Nov 2014 20:00:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2014 20:00:24 -0000 Received: from [127.0.0.1] ([127.0.0.1:15708]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 23/A2-59154-854D8745 for ; Fri, 28 Nov 2014 15:00:24 -0500 Authentication-Results: pb1.pair.com smtp.mail=carlos@jp7.com.br; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=carlos@jp7.com.br; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain jp7.com.br does not designate 209.85.216.41 as permitted sender) X-PHP-List-Original-Sender: carlos@jp7.com.br X-Host-Fingerprint: 209.85.216.41 mail-qa0-f41.google.com Received: from [209.85.216.41] ([209.85.216.41:38540] helo=mail-qa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/22-59154-83DC8745 for ; Fri, 28 Nov 2014 14:30:01 -0500 Received: by mail-qa0-f41.google.com with SMTP id f12so4932212qad.28 for ; Fri, 28 Nov 2014 11:29:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=MY6Nyvf/SOmzLx7M3dssCwSj5x1+JAbcLyxQ5qnPFzE=; b=QVmAMEIXyPIP+8VZTQvgO0qaJBoKdOHmAxp6hoJequk3b+3MNPHMBvY7lbwi92JQhm uUDl8ELz/f0UhhJs8PpibJ+haczlNW3FviOxYGmkmdyA/ZOdEcpiDcL+Tuy8L+4U1Jwd 9QJJBKZTCyqZJHFdTo3Gk8kL8gyqebhpwyyIhJQ9stNj/yRW2dXACKxT6DI+u08I0fA2 sIAL9BfRu+7RzO5TLUHFQa7DGyiEMpJJEnrjTjU4gmFznxFNtwmZtutbjcoy7QlZ9Zfe 0rof4ZmHEyCrvEWAj7K4zjMgdz1uAbQy7e6bSTesZCGnrqY9DvsafbsjBUb6MQ5kHfNP XiIA== X-Gm-Message-State: ALoCoQlWSBoGEvy6a3AAOlel+NutcCfwLnI8keVWtQGqm9yZntu5zG1uk1OZnrd0ValqR/DJj3Iu X-Received: by 10.140.101.68 with SMTP id t62mr63882633qge.92.1417202997504; Fri, 28 Nov 2014 11:29:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.192.225 with HTTP; Fri, 28 Nov 2014 11:29:37 -0800 (PST) Date: Fri, 28 Nov 2014 17:29:37 -0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11c170463dc4670508f04955 Subject: Static functions Vs Nonstatic functions From: carlos@jp7.com.br (Carlos Rodrigues) --001a11c170463dc4670508f04955 Content-Type: text/plain; charset=UTF-8 PHP has evolved a lot in recent years but we still can't have a static and a nonstatic function with the same name: class A { function bla() { echo 'normal'; } static function bla() { echo 'static'; } } A::bla(); ## ERROR: Cannot redeclare A::bla() And also PHP supports calling static functions as if they were not static: class B { static function bla() { echo 'how come it works'; } } $object = new B; $object->bla(); It confuses programmers that came from other languages, prevent APIs from having meaningful names on static methods and have no other benefit than supporting PHP 4 code. I'd appreciate if anyone with sufficient knowledge/influence helped me suggest this change to the maintainers. IMHO, static and nonstatic functions should be "stored" in different places. And if someone relies on this, one should use magic methods __call and __callStatic instead. Thanks for your time and patience, Carlos Rodrigues carlos@jp7.com.br --001a11c170463dc4670508f04955--