|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19980 Static method call from non-statiic method fails.
Submitted: 2002-10-18 10:07 UTC Modified: 2003-01-02 18:37 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: xczimi at sztaki dot hu Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.2.3 OS: Win2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: xczimi at sztaki dot hu
New email:
PHP Version: OS:


 [2002-10-18 10:07 UTC] xczimi at sztaki dot hu
when calling B::procSave from $a->procSave() the $this keeps linked to $a.

The code:

class A {
  function A() {}
  function procSave() {
    echo "A";
    if(isset($this)) echo "y"; else echo "n";

class B {
  function B() {}
  function procSave() {
    echo "B";
    if(isset($this)) echo "y"; else echo "n";

$a = new A();
$b = new B();




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-18 10:26 UTC]
And the output is?
 [2002-10-18 10:31 UTC] xczimi at sztaki dot hu
 [2002-10-18 15:43 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at
 [2002-10-18 19:46 UTC]
This came up on ZE2 list also, people seem to have a need for this. Please participate there.
 [2002-10-21 03:34 UTC] xczimi at sztaki dot hu
The example on the manual is correct, but here, the class A and the class B do not extend each other (they donot know anything about each other logically), so I do not think in a function of B the $this may be an object of class A.

Where can I find ZE2 list?
 [2002-10-21 11:41 UTC]
Reclassified. I guess ZE2 will solve this?

 [2002-12-08 17:12 UTC]
Please try the latest ZE2 cvs and see if the problem still exists.
 [2003-01-02 18:37 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jan 28 11:05:53 2023 UTC