php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60499 Classes and Objects - Scope Resolution Operator (::) - additional info
Submitted: 2011-12-12 14:34 UTC Modified: 2011-12-21 15:05 UTC
From: bogdan dot bezuz at emag dot ro Assigned: bjori (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bogdan dot bezuz at emag dot ro
New email:
PHP Version: OS:

 

 [2011-12-12 14:34 UTC] bogdan dot bezuz at emag dot ro
Description:
------------
Since it is (still) possible to call a non-static method in a static way i think this should be documented with a not recommended mention.

The section at http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php should contain also the example from http://php.net/language.oop5.basic#example-156




Test script:
---------------
class A  {
    public function foo() {
        var_dump($this->b);
    }
}

class B {
    public $b = 'stuff';

    public function bar() {
        A::foo();
    }
}

$b = new B();
$b->bar(); // will output string 'stuff' (length=5)

Expected result:
----------------
error

Actual result:
--------------
string 'stuff' (length=5)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-21 15:05 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=321294
Log: Link to a trickery example, fixes bug#60499
 [2011-12-21 15:05 UTC] bjori@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2011-12-21 15:05 UTC] bjori@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bjori
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 04:01:30 2025 UTC