ID:               34448
 Updated by:       [EMAIL PROTECTED]
 Reported By:      diplex19 at yandex dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows
 PHP Version:      5.0.5
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Your code is broken too...


Previous Comments:
------------------------------------------------------------------------

[2005-09-09 21:07:56] diplex19 at yandex dot ru

Description:
------------
Global variables inside of a method of a class are not initialized

Reproduce code:
---------------
<?
  class test1
  {
     var $my_var;
     function init($str)    { $this->my_var=$str; return $this->my_var;
}
  }
  class bug_test
  {
     function set_var($str) { global $info; $info=&new test1(); return
$info->init($str); }
     function get_var()     { global $info; return $info->my_var; }
  }
  global $info; 
  $t=&new bug_test();
  $f0=$t->set_var('menu1');
  $f1=$t->get_var();
  $f2=$t->set_var('menu2');
  $f3=$t->get_var();
  echo "f0=$f0\nf1=$f1\nf2=$f2\nf3=$f3\n";  // php-bug! f1<>'menu1' &
f3<>'menu2
?>

Expected result:
----------------
f0=menu1
f1=menu1
f2=menu2
f3=menu2

Actual result:
--------------
f0=menu1
f1=
f2=menu2
f3=


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34448&edit=1

Reply via email to