|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #708 assignment of a value to a one member variable of a class affects other vars.
Submitted: 1998-08-31 06:47 UTC Modified: 1998-08-31 11:04 UTC
From: hughm at idl dot net dot au Assigned:
Status: Closed Package: Other
PHP Version: 3.0 Final Release OS: linux 2.0.35
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:
49 + 18 = ?
Subscribe to this entry?

 [1998-08-31 06:47 UTC] hughm at idl dot net dot au
using apache 1.3.0 on a linux 2.0.35 libc5 setup.
(apache configure line)
./configure --prefix=/drives/web/apache_1.3.0 \
                --activate-module=src/modules/extra/mod_auth_mysql.o \
                --activate-module=src/modules/extra/mod_log_mysql.o \
                --activate-module=src/modules/php3/libphp3.a \
                --activate-module=src/modules/standard/mod_rewrite.o \

the following script gives un-expected results:

 class simple {
        var $somevar,$differvar;
        function init() {
          echo "this->somevar: ",$this->$somevar,"<BR>";
          echo "this->somevar: ",$this->$somevar,"<BR>";
          echo "this->differvar: ",$this->$differvar,"<BR>";

$tester =new simple;

<B>expected results:</B>
this->somevar: 1
this->somevar: 1
this->differvar: 2

<B>results obtained:</B>
this->somevar: 1
this->somevar: 2
this->differvar: 2

hashing problem ?
regex problem ?

Hugh Madden


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-31 11:04 UTC] zeev
c. none of the above - script problem

I think you could have figured that this was way too basic
to be a bug :)

Turn on error reporting all the way up by calling
or, if you have the old 3.00,
and I'm sure you'll figure where you were wrong.

Properties are not referenced like this:
but like this

$foo->$bar has a totally different meaning.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 13:01:28 2024 UTC