pwm with delay

int led = 3;
int i = 0;
long interval = 10;
long previousMillis = 0;
int lastcheck = 0;

void setup()
{
  Serial.begin (9600);
  pinMode (led, OUTPUT);
}
void loop()
{
  unsigned long currentMillis = millis();
 for (int i=0;i<=255;i++)
{
  if (millis() - lastcheck > interval)
  {
    lastcheck = millis();
    analogWrite (led, i);
  }
  Serial.println (i);
}
}

The above code works as intended. It resets the led to 0 every time through the loop. The following code works in a different way. Once the led reaches 255, it stays there constantly lit. As I said a few times, I'm trying to learn different ways of implementing a delay without "delay()." That's why it "wasn't sticking."

int led = 3;
int i = 0;
long interval = 10;
long previousMillis = 0;

void setup()
{
  Serial.begin (9600);
  pinMode (led, OUTPUT);
}
void loop()
{
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    analogWrite (led, i++);
    i = constrain (i,0,255);
    Serial.println (i);
  }
 // analogWrite (led, 0);
  //Serial.println (i);
}