public static function lineNumbers($code, $eol = "\n", $begin = 1) {
    $cut = FALSE;
    if (!static::endsWith($code, $eol)) {
      $code .= $eol;
      $cut = -mb_strlen($eol);
    }
    $lines = mb_substr_count($code, $eol);
    $padWhite = mb_strlen((string) $lines); // darstellung der größten zeilen-nummer als string
    $cnt = $begin;
    $linedCode = Preg::replace_callback($code, '/(.*?)'.$eol.'/',
      function ($match) use (&$cnt, $padWhite) {
        return sprintf('%s %s', StringUtil::padRight((string) $cnt++, $padWhite,' '), $match[0]);
      }
    );
    
    if ($cut !== FALSE) {
      return mb_substr($linedCode, 0, $cut);
    } else {
      return $linedCode;
    }
  }