<?php
class Number {
public $number;
public function __construcnt(){
$this->number = $number;
}
public function getNumber($number){
switch($number){
case $number == 0:
return "Все работает правильно";
case $number == 1:
return "ruble";
case $number == 2 || $number == 3 || $number == 4:
return "rublya";
case $number == 5 || $number == 6 || $number == 7 || $number == 8 || $number == 9:
return "rublei";
}
}
}
$numb = new Number();
echo $numb->getNumber(0);
PD9waHAKCmNsYXNzIE51bWJlciB7CglwdWJsaWMgJG51bWJlcjsKCXB1YmxpYyBmdW5jdGlvbiBfX2NvbnN0cnVjbnQoKXsKCQkkdGhpcy0+bnVtYmVyID0gJG51bWJlcjsKCX0KCXB1YmxpYyBmdW5jdGlvbiBnZXROdW1iZXIoJG51bWJlcil7CgkJc3dpdGNoKCRudW1iZXIpewoJCWNhc2UgJG51bWJlciA9PSAwOgoJCQlyZXR1cm4gItCS0YHQtSDRgNCw0LHQvtGC0LDQtdGCINC/0YDQsNCy0LjQu9GM0L3QviI7CgkJY2FzZSAkbnVtYmVyID09IDE6CgkJCXJldHVybiAicnVibGUiOwoJCQljYXNlICRudW1iZXIgPT0gMiB8fCAkbnVtYmVyID09IDMgfHwgJG51bWJlciA9PSA0OgoJCQkJcmV0dXJuICJydWJseWEiOwoJCQkJY2FzZSAkbnVtYmVyID09IDUgfHwgJG51bWJlciA9PSA2IHx8ICRudW1iZXIgPT0gNyB8fCAkbnVtYmVyID09IDggfHwgJG51bWJlciA9PSA5OgoJCQkJCXJldHVybiAicnVibGVpIjsKCQkJCQkKCX0KCX0KCQoJfQoJJG51bWIgPSBuZXcgTnVtYmVyKCk7CgllY2hvICRudW1iLT5nZXROdW1iZXIoMCk7Cgk=