3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num_total = 10; $num_right = 0; $subanswer = 'A~D~F'; if (strpos($subanswer,'~') !== FALSE) { $subanswer = explode('~',$subanswer); } $trueanswer = 'A~C~E~F'; if (strpos($trueanswer,'~') !== FALSE) { $trueanswer = explode('~',$trueanswer); } $string = 'A'; for ($i = 0; $i < $num_total; $i++) { echo $subanswer; if ($subanswer[0] == $string) { if ($subanswer[0] == $trueanswer[0]) { $num_right ++; } else { $num_right --; } $subanswer = array_shift($subanswer); } if ($trueanswer[0] == $string) { $trueanswer = array_shift($trueanswer); } $string ++; } $correct = $num_right/$num_total*100; echo $correct; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 29
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 44
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 51
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 29
Branch analysis from position: 55
Branch analysis from position: 29
Branch analysis from position: 51
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 51
Branch analysis from position: 47
Branch analysis from position: 51
Branch analysis from position: 44
Branch analysis from position: 26
Branch analysis from position: 14
filename:       /in/J9OLk
function name:  (null)
number of ops:  60
compiled vars:  !0 = $num_total, !1 = $num_right, !2 = $subanswer, !3 = $trueanswer, !4 = $string, !5 = $i, !6 = $correct
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 10
    3     1        ASSIGN                                                   !1, 0
    4     2        ASSIGN                                                   !2, 'A%7ED%7EF'
    5     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !2
          5        SEND_VAL                                                 '%7E'
          6        DO_ICALL                                         $10     
          7        TYPE_CHECK                                  1018          $10
          8      > JMPZ                                                     ~11, ->14
    6     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%7E'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !2, $12
    8    14    >   ASSIGN                                                   !3, 'A%7EC%7EE%7EF'
    9    15        INIT_FCALL                                               'strpos'
         16        SEND_VAR                                                 !3
         17        SEND_VAL                                                 '%7E'
         18        DO_ICALL                                         $15     
         19        TYPE_CHECK                                  1018          $15
         20      > JMPZ                                                     ~16, ->26
   10    21    >   INIT_FCALL                                               'explode'
         22        SEND_VAL                                                 '%7E'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $17     
         25        ASSIGN                                                   !3, $17
   12    26    >   ASSIGN                                                   !4, 'A'
   13    27        ASSIGN                                                   !5, 0
         28      > JMP                                                      ->53
   14    29    >   ECHO                                                     !2
   15    30        FETCH_DIM_R                                      ~21     !2, 0
         31        IS_EQUAL                                                 !4, ~21
         32      > JMPZ                                                     ~22, ->44
   16    33    >   FETCH_DIM_R                                      ~23     !2, 0
         34        FETCH_DIM_R                                      ~24     !3, 0
         35        IS_EQUAL                                                 ~23, ~24
         36      > JMPZ                                                     ~25, ->39
   17    37    >   PRE_INC                                                  !1
         38      > JMP                                                      ->40
   19    39    >   PRE_DEC                                                  !1
   21    40    >   INIT_FCALL                                               'array_shift'
         41        SEND_REF                                                 !2
         42        DO_ICALL                                         $28     
         43        ASSIGN                                                   !2, $28
   23    44    >   FETCH_DIM_R                                      ~30     !3, 0
         45        IS_EQUAL                                                 !4, ~30
         46      > JMPZ                                                     ~31, ->51
   24    47    >   INIT_FCALL                                               'array_shift'
         48        SEND_REF                                                 !3
         49        DO_ICALL                                         $32     
         50        ASSIGN                                                   !3, $32
   26    51    >   PRE_INC                                                  !4
   13    52        PRE_INC                                                  !5
         53    >   IS_SMALLER                                               !5, !0
         54      > JMPNZ                                                    ~36, ->29
   28    55    >   DIV                                              ~37     !1, !0
         56        MUL                                              ~38     ~37, 100
         57        ASSIGN                                                   !6, ~38
   29    58        ECHO                                                     !6
   31    59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.03 ms | 1400 KiB | 19 Q