|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19478 Two classes error
Submitted: 2002-09-18 11:26 UTC Modified: 2002-10-03 05:46 UTC
From: to at andybutkaj dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.2.2 OS: Windows 2000 and Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: to at andybutkaj dot com
New email:
PHP Version: OS:


 [2002-09-18 11:26 UTC] to at andybutkaj dot com
    class test
        var $_value;

        function test_static ($to)
            $this->_value = $to;

    class test2
        var $_value;

        function use_test ()
            $this->_value = 7;

            $y = new test();
            echo "<p>value: ".$this->_value."</p>";

            test::test_static (5);
            echo "<p>value: ".$this->_value."</p>";


    $x=new test2();

First echo returns value 7
Second echo returns value 5

is this correct?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-03 04:47 UTC]
Yes it is. To get 5 for the first example, you must output the value of $y->_value.

Regards, Kai
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 12:01:25 2023 UTC