fork download
  1. <?php
  2.  
  3. class Number {
  4. public $number;
  5. public function __construcnt(){
  6. $this->number = $number;
  7. }
  8. public function getNumber($number){
  9. switch($number){
  10. case $number == 0:
  11. return "Все работает правильно";
  12. case $number == 1:
  13. return "ruble";
  14. case $number == 2 || $number == 3 || $number == 4:
  15. return "rublya";
  16. case $number == 5 || $number == 6 || $number == 7 || $number == 8 || $number == 9:
  17. return "rublei";
  18.  
  19. }
  20. }
  21.  
  22. }
  23. $numb = new Number();
  24. echo $numb->getNumber(0);
  25.  
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
ruble