Hello there. Here is my php code
PHP Code:
class car{
static $one=1;
static function change()
{
self::$one=self::$one++;
}
}
car::$one=2;
echo car::$one."<br />";
echo car::change();
echo car::$one."<br />";
echo car::change();
echo car::$one."<br />";
echo car::change();
echo car::$one."<br />";
I expected it to increment the variable but it echoed 2 2 2 2 instead of expected 2 3 4 5
Thank you for your attention!!!
Will be waiting