|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 - 30 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 09:01:26 2024 UTC