Date: 05/29/00
- Next message: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4661: Class variable corruption"
- Previous message: dphillips <email protected>: "[PHP-DEV] PHP 4.0 Bug #4660: Fails to compile due to missing include file"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4661: Class variable corruption"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4661: Class variable corruption"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: Jim.Moores <email protected>
Operating system: Redhat 6.1
PHP version: 4.0.0 Release
PHP Bug Type: Scripting Engine problem
Bug description: Class variable corruption
Hi guys,
I think I've found a nasty bug, at first I thought it was bug #2467, but you claimed to have fixed that last october. I tried upgrading from RC1 to 4.0.0 but it didn't help (and I am sure the upgrade worked becuase phpinfo() reports the new version). I enclose a short script to demonstrate the problem. The script should output the same value twice, but when another variable is written to in bewteen echo's, it corrupts the value. We have had a problem with our compiler, egcs 2.91.66 needing to be run repeatedly on the php-4.0.0 release sources, but I don't think its related..?
Anyway, here it is - it should print "1 1", but instead it prints "1 2". It also acts differently if you change the name of the constructor function (so it's no longer the constructor), you get a different value, I think).
<?
class ProductList {
var $grp_index;
var $name_index;
/* Constructor */
function ProductList() {
$this->$grp_index = 1; # Yuck!!!
}
function nextEntry() {
echo $this->$grp_index;
echo "<br>";
$this->$name_index = 2;
echo $this->$grp_index;
}
}
$pl = new ProductList;
$pl->nextEntry();
?>
Anything you could do would be greatly appreciated, I'm having real trouble developping with this bug!
Thanks
Jim Moores, Quickstone Systems, UK.
PS. our configuration is just the same as in the quick install guide.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4661: Class variable corruption"
- Previous message: dphillips <email protected>: "[PHP-DEV] PHP 4.0 Bug #4660: Fails to compile due to missing include file"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4661: Class variable corruption"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4661: Class variable corruption"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

