Choosing a color based on exam score
Note: I do not advocate this to be used, it is definitely wrong, untested, horrible and confusing.

But it should give you a start in using the associative array method that Alexander Kludt noted in his comment.

&lt;?php
class Smth 
{
    protected $marks = array(
        'Undefined' =&gt; 0, 'ECTS-F' =&gt; 0.31, 'ECTS-FX' =&gt; 0.60, 'ECTS-E' =&gt; 0.65, 
        'ECTS-D' 0.71, 'ECTS-C' =&gt; 0.85, 'ECTS-B' =&gt; 0.95, 'ECTS-A'
    );

    public function getEctsMark($rate, $current, $examRate) 
    {
        $color = reset($this-&gt;marks);
        $percent = $rate / $current;

        if($current &gt; 0 &amp;&amp; $examRate &lt; 22) {
            return "ECTS-FX";
        }

        /**
         * This is where the explanation is required. This *should* *maybe*
         * compare the percent to the current start band and the next band. So 
         * say for example the percent is 0.78(78%) this would foreach through 
         * the  marks array and eventually return true on &gt;= $percentStart(0.71)
         * and &lt;= the next band start up which is 0.85.
         */
        $i = 0;
        foreach($this-&gt;marks as $key =&gt; $percentStart) {
            if($percent &gt;= $percentStart &amp;&amp; $percentStart &lt;= $this-&gt;marks[$i+1]) {
                $color = $key;
                break;
            }           
            $i++;
        }

        return $color;
    }
}


If you are wanting feedback on your original code, I made a few changes which might satisfy your criteria of simplification over at this 3v4l.