[PHP-DEV] PHP 4.0 Bug #3361: Crash + variables work incorrectly + alloc message From: stas <email protected>
Date: 01/31/00

From: stas <email protected>
Operating system: Linux
PHP version: 4.0 Latest CVS (31/01/2000)
PHP Bug Type: Reproduceable crash
Bug description: Crash + variables work incorrectly + alloc message

Script:

<?

class x {
  var $foo = "";
  var $bar = "";
  function set($x) {
    foreach($x as $k => $v) {
        $this->$k = $v;
    }
  }
}

$xx = new x();
$xx->set(array("foo" => "1","bar" => 2));
var_dump($xx);
?>

gives 3 strange results:

1. Crash:
Program received signal SIGSEGV, Segmentation fault.
shutdown_memory_manager (silent=0, clean_cache=0) at zend_alloc.c:354
354 next_fast_cache_list_entry = fast_cache_list_entry->next;
#0 shutdown_memory_manager (silent=0, clean_cache=0) at zend_alloc.c:354
#1 0x8075b33 in php_request_shutdown (dummy=0x0) at main.c:737
#2 0x805a0d2 in main (argc=2, argv=0xbffff894) at cgi_main.c:542

2. Dump is:
object of x (2) {
  string(3) "foo"
  string(0) ""

  string(3) "bar"
  string(0) ""
}

which is wrong - variables aren't set

3. Message from zend_alloc
---------------------------------------
zend_alloc.c(355) : Block 0x0812E100 status:
Beginning: Cached (allocated on ./zend_execute.c:2152, 12 bytes)
      End: OK
---------------------------------------

-- 
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>