3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(-1); abstract class Question { public $text; // текст вопроса public $points = 5; // число баллов, по умолчанию 5 public $hint; // подсказка abstract function checkQuestionAndAnswer($answer); } class ChoiceQuestion extends Question { public $options; // варианты ответа public $correctOption; // правильный вариант public function checkQuestionAndAnswer($answer) { if ($this->correctOption == $answer) { return true; } else { return false; } } } class NumericQuestion extends Question { public $correctAnswer; // правильный ответ public $deviation; // допустимая погрешность public function checkQuestionAndAnswer($answer) { if ($this->correctAnswer == $answer) { return true; } elseif ($answer == $this->correctAnswer - $this->deviation || $answer == $this->correctAnswer + $this->deviation) { return true; } else { return false; } } } // Функция, создающая массив с вопросами: function createQuestions() { // Создаем пустой массив $questions = []; // Вопрос 1 $q1 = new ChoiceQuestion; $q1->text = "Какая планета располагается четвертой по счету от Солнца?"; $q1->points = 10; // 10 баллов за ответ $q1->options = array('a' => 'Венера', 'b' => 'Марс', 'c' => 'Юпитер', 'd' => 'Меркурий'); // Варианты ответа $q1->correctOption = 'b'; // Правильный ответ $q1->hint = 'Сникерс'; // Подсказка $questions[] = $q1; // Вопрос 2 $q2 = new ChoiceQuestion; $q2->text = 'Какой город является столицей Великобритании?'; $q2->points = 5; $q2->options = array('a' => 'Париж', 'b' => 'Москва', 'c' => 'Нью-Йорк', 'd' => 'Лондон'); $q2->correctOption = 'd'; $q2->hint = 'London is the capital of Great Britain'; // Подсказка $questions[] = $q2; // Вопрос 3 $q3 = new ChoiceQuestion; $q3->text = 'Кто придумал теорию относительности?'; $q3->points = 30; $q3->options = array('a' => 'Джон Леннон', 'b' => 'Джим Моррисон', 'c' => 'Альберт Эйнштейн', 'd' => 'Исаак Ньютон'); $q3->correctOption = 'c'; $q3->hint = 'Какой-то еврей... Подождите... Ох, нет...'; // Подсказка $questions[] = $q3; // Вопрос 4 - с выбором цифры $q4 = new NumericQuestion; $q4->text = 'Напишите число Пи до тысячных или хотя бы сотых.'; $q4->points = 30; $q4->correctAnswer = 3.141; $q4->deviation = 0.001; $q4->hint = 'Это 3,14здец какой-то...'; // Подсказка $questions[] = $q4; return $questions; } function checkAnswers($questions, $answers) { if (count($questions) != count($answers)) { die("Число ответов и вопросов не совпадает\n"); } $number = 0; $pointsTotal = 0; // сколько набрано баллов $pointsMax = 0; // сколько можно набрать баллов при всех правильных ответах $correctAnswers = 0; // сколько отвечено верно $totalQuestions = count($questions); // Сколько всего вопросов // Если ответ из массива $answers и правильный ответ для соответствующего вопроса совпадают - плюсуются $correctAnswers, $pointsTotal for ($i = 0; $i < count($questions); $i++) { $number = $i + 1; $pointsMax += $questions[$i]->points; if ($questions[$i]->checkQuestionAndAnswer($answers[$i]) == true) { echo "Ответ на вопрос {$number} правильный\n\n"; $correctAnswers++; $pointsTotal += $questions[$i]->points; } else { echo "Ответ на вопрос {$number} НЕправильный\n Подсказка: {$questions[$i]->hint}\n\n"; } } echo "Всего набрано баллов $pointsTotal из $pointsMax.\n Всего правильных ответов: $correctAnswers.\n Всего было вопросов: $totalQuestions\n"; } function printQuestions($questions) { $number = 1; // номер вопроса foreach ($questions as $question) { echo "\n{$number}. {$question->text}\n\n"; if (isset($question->options)) { echo "Варианты ответов:\n"; foreach ($question->options as $letter => $answer) { echo " {$letter}. {$answer}\n"; } } $number++; } } $questions = createQuestions(); $answers = array('b', 'd', 'a', 3.14); printQuestions($questions); checkAnswers($questions, $answers);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgP74
function name:  (null)
number of ops:  15
compiled vars:  !0 = $questions, !1 = $answers
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     -1
          2        DO_ICALL                                                     
  131     3        INIT_FCALL                                                   'createquestions'
          4        DO_FCALL                                          0  $3      
          5        ASSIGN                                                       !0, $3
  132     6        ASSIGN                                                       !1, <array>
  133     7        INIT_FCALL                                                   'printquestions'
          8        SEND_VAR                                                     !0
          9        DO_FCALL                                          0          
  134    10        INIT_FCALL                                                   'checkanswers'
         11        SEND_VAR                                                     !0
         12        SEND_VAR                                                     !1
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1

Function createquestions:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgP74
function name:  createQuestions
number of ops:  63
compiled vars:  !0 = $questions, !1 = $q1, !2 = $q2, !3 = $q3, !4 = $q4
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   49     0  E >   ASSIGN                                                       !0, <array>
   51     1        NEW                                                  $6      'ChoiceQuestion'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $6
   52     4        ASSIGN_OBJ                                                   !1, 'text'
          5        OP_DATA                                                      '%D0%9A%D0%B0%D0%BA%D0%B0%D1%8F+%D0%BF%D0%BB%D0%B0%D0%BD%D0%B5%D1%82%D0%B0+%D1%80%D0%B0%D1%81%D0%BF%D0%BE%D0%BB%D0%B0%D0%B3%D0%B0%D0%B5%D1%82%D1%81%D1%8F+%D1%87%D0%B5%D1%82%D0%B2%D0%B5%D1%80%D1%82%D0%BE%D0%B9+%D0%BF%D0%BE+%D1%81%D1%87%D0%B5%D1%82%D1%83+%D0%BE%D1%82+%D0%A1%D0%BE%D0%BB%D0%BD%D1%86%D0%B0%3F'
   53     6        ASSIGN_OBJ                                                   !1, 'points'
          7        OP_DATA                                                      10
   54     8        ASSIGN_OBJ                                                   !1, 'options'
          9        OP_DATA                                                      <array>
   55    10        ASSIGN_OBJ                                                   !1, 'correctOption'
         11        OP_DATA                                                      'b'
   56    12        ASSIGN_OBJ                                                   !1, 'hint'
         13        OP_DATA                                                      '%D0%A1%D0%BD%D0%B8%D0%BA%D0%B5%D1%80%D1%81'
   57    14        ASSIGN_DIM                                                   !0
         15        OP_DATA                                                      !1
   59    16        NEW                                                  $15     'ChoiceQuestion'
         17        DO_FCALL                                          0          
         18        ASSIGN                                                       !2, $15
   60    19        ASSIGN_OBJ                                                   !2, 'text'
         20        OP_DATA                                                      '%D0%9A%D0%B0%D0%BA%D0%BE%D0%B9+%D0%B3%D0%BE%D1%80%D0%BE%D0%B4+%D1%8F%D0%B2%D0%BB%D1%8F%D0%B5%D1%82%D1%81%D1%8F+%D1%81%D1%82%D0%BE%D0%BB%D0%B8%D1%86%D0%B5%D0%B9+%D0%92%D0%B5%D0%BB%D0%B8%D0%BA%D0%BE%D0%B1%D1%80%D0%B8%D1%82%D0%B0%D0%BD%D0%B8%D0%B8%3F'
   61    21        ASSIGN_OBJ                                                   !2, 'points'
         22        OP_DATA                                                      5
   62    23        ASSIGN_OBJ                                                   !2, 'options'
         24        OP_DATA                                                      <array>
   63    25        ASSIGN_OBJ                                                   !2, 'correctOption'
         26        OP_DATA                                                      'd'
   64    27        ASSIGN_OBJ                                                   !2, 'hint'
         28        OP_DATA                                                      'London+is+the+capital+of+Great+Britain'
   65    29        ASSIGN_DIM                                                   !0
         30        OP_DATA                                                      !2
   67    31        NEW                                                  $24     'ChoiceQuestion'
         32        DO_FCALL                                          0          
         33        ASSIGN                                                       !3, $24
   68    34        ASSIGN_OBJ                                                   !3, 'text'
         35        OP_DATA                                                      '%D0%9A%D1%82%D0%BE+%D0%BF%D1%80%D0%B8%D0%B4%D1%83%D0%BC%D0%B0%D0%BB+%D1%82%D0%B5%D0%BE%D1%80%D0%B8%D1%8E+%D0%BE%D1%82%D0%BD%D0%BE%D1%81%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8%3F'
   69    36        ASSIGN_OBJ                                                   !3, 'points'
         37        OP_DATA                                                      30
   70    38        ASSIGN_OBJ                                                   !3, 'options'
         39        OP_DATA                                                      <array>
   71    40        ASSIGN_OBJ                                                   !3, 'correctOption'
         41        OP_DATA                                                      'c'
   72    42        ASSIGN_OBJ                                                   !3, 'hint'
         43        OP_DATA                                                      '%D0%9A%D0%B0%D0%BA%D0%BE%D0%B9-%D1%82%D0%BE+%D0%B5%D0%B2%D1%80%D0%B5%D0%B9...+%D0%9F%D0%BE%D0%B4%D0%BE%D0%B6%D0%B4%D0%B8%D1%82%D0%B5...+%D0%9E%D1%85%2C+%D0%BD%D0%B5%D1%82...'
   73    44        ASSIGN_DIM                                                   !0
         45        OP_DATA                                                      !3
   75    46        NEW                                                  $33     'NumericQuestion'
         47        DO_FCALL                                          0          
         48        ASSIGN                                                       !4, $33
   76    49        ASSIGN_OBJ                                                   !4, 'text'
         50        OP_DATA                                                      '%D0%9D%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5+%D1%87%D0%B8%D1%81%D0%BB%D0%BE+%D0%9F%D0%B8+%D0%B4%D0%BE+%D1%82%D1%8B%D1%81%D1%8F%D1%87%D0%BD%D1%8B%D1%85+%D0%B8%D0%BB%D0%B8+%D1%85%D0%BE%D1%82%D1%8F+%D0%B1%D1%8B+%D1%81%D0%BE%D1%82%D1%8B%D1%85.'
   77    51        ASSIGN_OBJ                                                   !4, 'points'
         52        OP_DATA                                                      30
   78    53        ASSIGN_OBJ                                                   !4, 'correctAnswer'
         54        OP_DATA                                                      3.141
   79    55        ASSIGN_OBJ                                                   !4, 'deviation'
         56        OP_DATA                                                      0.001
   80    57        ASSIGN_OBJ                                                   !4, 'hint'
         58        OP_DATA                                                      '%D0%AD%D1%82%D0%BE+3%2C14%D0%B7%D0%B4%D0%B5%D1%86+%D0%BA%D0%B0%D0%BA%D0%BE%D0%B9-%D1%82%D0%BE...'
   81    59        ASSIGN_DIM                                                   !0
         60        OP_DATA                                                      !4
   82    61      > RETURN                                                       !0
   83    62*     > RETURN                                                       null

End of function createquestions

Function checkanswers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 17
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 39
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 17
Branch analysis from position: 51
Branch analysis from position: 17
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 17
Branch analysis from position: 51
Branch analysis from position: 17
filename:       /in/cgP74
function name:  checkAnswers
number of ops:  62
compiled vars:  !0 = $questions, !1 = $answers, !2 = $number, !3 = $pointsTotal, !4 = $pointsMax, !5 = $correctAnswers, !6 = $totalQuestions, !7 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   85     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   87     2        COUNT                                                ~8      !0
          3        COUNT                                                ~9      !1
          4        IS_NOT_EQUAL                                                 ~8, ~9
          5      > JMPZ                                                         ~10, ->9
   88     6    > > INIT_FCALL                                                   'exit'
          7*       SEND_VAL                                                     '%D0%A7%D0%B8%D1%81%D0%BB%D0%BE+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2+%D0%B8+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B2+%D0%BD%D0%B5+%D1%81%D0%BE%D0%B2%D0%BF%D0%B0%D0%B4%D0%B0%D0%B5%D1%82%0A'
          8*       DO_ICALL                                                     
   90     9    >   ASSIGN                                                       !2, 0
   91    10        ASSIGN                                                       !3, 0
   92    11        ASSIGN                                                       !4, 0
   93    12        ASSIGN                                                       !5, 0
   94    13        COUNT                                                ~16     !0
         14        ASSIGN                                                       !6, ~16
   98    15        ASSIGN                                                       !7, 0
         16      > JMP                                                          ->48
   99    17    >   ADD                                                  ~19     !7, 1
         18        ASSIGN                                                       !2, ~19
  100    19        FETCH_DIM_R                                          ~21     !0, !7
         20        FETCH_OBJ_R                                          ~22     ~21, 'points'
         21        ASSIGN_OP                                         1          !4, ~22
  101    22        FETCH_DIM_R                                          ~24     !0, !7
         23        INIT_METHOD_CALL                                             ~24, 'checkQuestionAndAnswer'
         24        CHECK_FUNC_ARG                                               
         25        FETCH_DIM_FUNC_ARG                                   $25     !1, !7
         26        SEND_FUNC_ARG                                                $25
         27        DO_FCALL                                          0  $26     
         28        IS_EQUAL                                                     $26, <true>
         29      > JMPZ                                                         ~27, ->39
  102    30    >   ROPE_INIT                                         3  ~29     '%D0%9E%D1%82%D0%B2%D0%B5%D1%82+%D0%BD%D0%B0+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81+'
         31        ROPE_ADD                                          1  ~29     ~29, !2
         32        ROPE_END                                          2  ~28     ~29, '+%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9%0A%0A'
         33        ECHO                                                         ~28
  103    34        PRE_INC                                                      !5
  104    35        FETCH_DIM_R                                          ~32     !0, !7
         36        FETCH_OBJ_R                                          ~33     ~32, 'points'
         37        ASSIGN_OP                                         1          !3, ~33
  101    38      > JMP                                                          ->47
  106    39    >   ROPE_INIT                                         5  ~38     '%D0%9E%D1%82%D0%B2%D0%B5%D1%82+%D0%BD%D0%B0+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81+'
         40        ROPE_ADD                                          1  ~38     ~38, !2
         41        ROPE_ADD                                          2  ~38     ~38, '+%D0%9D%D0%95%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9%0A+%D0%9F%D0%BE%D0%B4%D1%81%D0%BA%D0%B0%D0%B7%D0%BA%D0%B0%3A+'
         42        FETCH_DIM_R                                          ~35     !0, !7
         43        FETCH_OBJ_R                                          ~36     ~35, 'hint'
         44        ROPE_ADD                                          3  ~38     ~38, ~36
         45        ROPE_END                                          4  ~37     ~38, '%0A%0A'
         46        ECHO                                                         ~37
   98    47    >   PRE_INC                                                      !7
         48    >   COUNT                                                ~42     !0
         49        IS_SMALLER                                                   !7, ~42
         50      > JMPNZ                                                        ~43, ->17
  111    51    >   ROPE_INIT                                         9  ~45     '%D0%92%D1%81%D0%B5%D0%B3%D0%BE+%D0%BD%D0%B0%D0%B1%D1%80%D0%B0%D0%BD%D0%BE+%D0%B1%D0%B0%D0%BB%D0%BB%D0%BE%D0%B2+'
         52        ROPE_ADD                                          1  ~45     ~45, !3
         53        ROPE_ADD                                          2  ~45     ~45, '+%D0%B8%D0%B7+'
         54        ROPE_ADD                                          3  ~45     ~45, !4
         55        ROPE_ADD                                          4  ~45     ~45, '.%0A+%D0%92%D1%81%D0%B5%D0%B3%D0%BE+%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D1%85+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2%3A+'
         56        ROPE_ADD                                          5  ~45     ~45, !5
         57        ROPE_ADD                                          6  ~45     ~45, '.%0A+%D0%92%D1%81%D0%B5%D0%B3%D0%BE+%D0%B1%D1%8B%D0%BB%D0%BE+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B2%3A++'
         58        ROPE_ADD                                          7  ~45     ~45, !6
         59        ROPE_END                                          8  ~44     ~45, '%0A'
         60        ECHO                                                         ~44
  112    61      > RETURN                                                       null

End of function checkanswers

Function printquestions:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 26
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/cgP74
function name:  printQuestions
number of ops:  30
compiled vars:  !0 = $questions, !1 = $number, !2 = $question, !3 = $answer, !4 = $letter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  114     0  E >   RECV                                                 !0      
  116     1        ASSIGN                                                       !1, 1
  118     2      > FE_RESET_R                                           $6      !0, ->28
          3    > > FE_FETCH_R                                                   $6, !2, ->28
  119     4    >   ROPE_INIT                                         5  ~9      '%0A'
          5        ROPE_ADD                                          1  ~9      ~9, !1
          6        ROPE_ADD                                          2  ~9      ~9, '.+'
          7        FETCH_OBJ_R                                          ~7      !2, 'text'
          8        ROPE_ADD                                          3  ~9      ~9, ~7
          9        ROPE_END                                          4  ~8      ~9, '%0A%0A'
         10        ECHO                                                         ~8
  120    11        ISSET_ISEMPTY_PROP_OBJ                                       !2, 'options'
         12      > JMPZ                                                         ~12, ->26
  121    13    >   ECHO                                                         '%D0%92%D0%B0%D1%80%D0%B8%D0%B0%D0%BD%D1%82%D1%8B+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2%3A%0A'
  123    14        FETCH_OBJ_R                                          ~13     !2, 'options'
         15      > FE_RESET_R                                           $14     ~13, ->25
         16    > > FE_FETCH_R                                           ~15     $14, !3, ->25
         17    >   ASSIGN                                                       !4, ~15
  124    18        ROPE_INIT                                         5  ~18     '++'
         19        ROPE_ADD                                          1  ~18     ~18, !4
         20        ROPE_ADD                                          2  ~18     ~18, '.+'
         21        ROPE_ADD                                          3  ~18     ~18, !3
         22        ROPE_END                                          4  ~17     ~18, '%0A'
         23        ECHO                                                         ~17
  123    24      > JMP                                                          ->16
         25    >   FE_FREE                                                      $14
  127    26    >   PRE_INC                                                      !1
  118    27      > JMP                                                          ->3
         28    >   FE_FREE                                                      $6
  129    29      > RETURN                                                       null

End of function printquestions

Class Question:
Function checkquestionandanswer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgP74
function name:  checkQuestionAndAnswer
number of ops:  2
compiled vars:  !0 = $answer
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1      > RETURN                                                       null

End of function checkquestionandanswer

End of class Question.

Class ChoiceQuestion:
Function checkquestionandanswer:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgP74
function name:  checkQuestionAndAnswer
number of ops:  8
compiled vars:  !0 = $answer
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
   21     1        FETCH_OBJ_R                                          ~1      'correctOption'
          2        IS_EQUAL                                                     !0, ~1
          3      > JMPZ                                                         ~2, ->6
   22     4    > > RETURN                                                       <true>
   21     5*       JMP                                                          ->7
   24     6    > > RETURN                                                       <false>
   26     7*     > RETURN                                                       null

End of function checkquestionandanswer

End of class ChoiceQuestion.

Class NumericQuestion:
Function checkquestionandanswer:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/cgP74
function name:  checkQuestionAndAnswer
number of ops:  21
compiled vars:  !0 = $answer
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   34     0  E >   RECV                                                 !0      
   36     1        FETCH_OBJ_R                                          ~1      'correctAnswer'
          2        IS_EQUAL                                                     !0, ~1
          3      > JMPZ                                                         ~2, ->6
   37     4    > > RETURN                                                       <true>
   36     5*       JMP                                                          ->20
   38     6    >   FETCH_OBJ_R                                          ~3      'correctAnswer'
          7        FETCH_OBJ_R                                          ~4      'deviation'
          8        SUB                                                  ~5      ~3, ~4
          9        IS_EQUAL                                             ~6      !0, ~5
         10      > JMPNZ_EX                                             ~6      ~6, ->16
         11    >   FETCH_OBJ_R                                          ~7      'correctAnswer'
         12        FETCH_OBJ_R                                          ~8      'deviation'
         13        ADD                                                  ~9      ~7, ~8
         14        IS_EQUAL                                             ~10     !0, ~9
         15        BOOL                                                 ~6      ~10
         16    > > JMPZ                                                         ~6, ->19
   39    17    > > RETURN                                                       <true>
   38    18*       JMP                                                          ->20
   41    19    > > RETURN                                                       <false>
   43    20*     > RETURN                                                       null

End of function checkquestionandanswer

End of class NumericQuestion.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.3 ms | 2498 KiB | 18 Q