[PHP-DEV] Bug #331: static variables in object methods broken From: jdavis <email protected>
Date: 04/29/98

From: jdavis <email protected>
Operating system: linux
PHP version: 3.0 Release Candidate 4
PHP Bug Type: Other
Bug description:
sorry if i'm missing something but it would seem that the
following code should output:

1
2
3

instead $a never is set so it doesn't output anyting (except
the "<p>\n" part)

thank you and pls let me know if you need more info
-----

class foobar {

  function init () {

    static $a=1;

    print $a;
    print "<p>\n";
  
    $a++;
    }
};

$bar = new foobar; $bar->init(); $bar->init();
$bar->init();