Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79354 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48722 invoked from network); 1 Dec 2014 19:48:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Dec 2014 19:48:39 -0000 Authentication-Results: pb1.pair.com header.from=carlos@jp7.com.br; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=carlos@jp7.com.br; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain jp7.com.br does not designate 209.85.192.47 as permitted sender) X-PHP-List-Original-Sender: carlos@jp7.com.br X-Host-Fingerprint: 209.85.192.47 mail-qg0-f47.google.com Received: from [209.85.192.47] ([209.85.192.47:63239] helo=mail-qg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/E2-32869-616CC745 for ; Mon, 01 Dec 2014 14:48:39 -0500 Received: by mail-qg0-f47.google.com with SMTP id z60so8194437qgd.34 for ; Mon, 01 Dec 2014 11:48:36 -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:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Fnbcwfyn4t56HTIRKmEno6Wmk6g8XnPMiprg0C69+KE=; b=B3SUglVZM58mseZVWfVaHqFMvisDt4orDsLG7ZIT+29fQf8naS51nimdSqDIC75Of4 uu3d9HtZMRpklMfbK6yUI5ojgiltzb2vBfiREV917fbyznmkmV3eZp96rSSOYMlFEs9s 4zikjDl0933IKw91Dau2ZOD2cKarL9+wfidHa4ZxFznPUpaTmgYWUtV/2Qztn8WXXcsE VWpjR8xmYMSFmnG6Nrff8RTuyB7ATu1YJn80ecBcuGhqR0gB6aTyvY2hAd2XFZvPJG76 JQq3Qz9/yycN88LPUutwAfAjNyLXTlBh9uCtJFVdMs3Ttj6xH6QJybKR/oc0lgIxbMKo Qu2Q== X-Gm-Message-State: ALoCoQlSyaIjs1hHw8mXnpweBzENEiOoBZDgZbFOwuE0Bt0l1l8/Wj9dCN6ENJhRxxKVJHdnB49q X-Received: by 10.224.96.194 with SMTP id i2mr8499832qan.87.1417463316036; Mon, 01 Dec 2014 11:48:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.192.225 with HTTP; Mon, 1 Dec 2014 11:48:15 -0800 (PST) In-Reply-To: <547CA49E.1030604@gmail.com> References: <5478FE5B.8050803@gmail.com> <547CA49E.1030604@gmail.com> Date: Mon, 1 Dec 2014 17:48:15 -0200 Message-ID: To: Stanislav Malyshev Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11c2c17c6f5aa905092ce5ac Subject: Re: [PHP-DEV] Static functions Vs Nonstatic functions From: carlos@jp7.com.br (Carlos Rodrigues) --001a11c2c17c6f5aa905092ce5ac Content-Type: text/plain; charset=UTF-8 Hi, Glad to hear it was discussed. I understand you guys are busy and can't just change things out of nowhere, but i wish it will be dropped in the future. It it gets dropped in the future i will come back and ask to make it possible to call a static method and normal methods with the same name :P. For now i will just wait. Thx anyway, *Carlos Rodrigues* 2014-12-01 15:25 GMT-02:00 Stanislav Malyshev : > Hi! > > > class Cube { > > function weird() { > > echo Duck::foo(); > > } > > > > } > > > > class Duck { > > public function foo() { > > echo 'My class is: ' . get_class($this); > > } > > } > > > > $rubik = new Cube; > > $rubik->weird(); // Output: My class is: Cube > > This code produces: > > Deprecated: Non-static method Duck::foo() should not be called > statically, assuming $this from incompatible context > > which informs you about the fact that what you're doing is wrong. This > capability is kept for BC reasons. There was a discussion about dropping > this from PHP 7 but it wasn't yet decided to remove the support. In any > case, this has little to do with static and non-static functions having > different namespaces. > > -- > Stas Malyshev > smalyshev@gmail.com > --001a11c2c17c6f5aa905092ce5ac--