3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assertions = [ 1 => 1, 4 => 4, 5 => 5, 6 => 4, 8 => 2, 9 => 1, 10 => 2, 11 => 3, 12 => 4, 13 => 5, 14 => 4, 15 => 3, 16 => 2, 17 => 1, 18 => 2, 19 => 3, 20 => 4, 21 => 5, 22 => 4, ]; /** * @param positive-int $count * @return positive-int */ function countFingerPingPong(int $count): int { return abs(((abs($i-5)%8))-4)+1; } foreach($assertions as $count => $assert) { if (countFingerPingPong($count) !== $assert) { throw new Exception('Assesstions failed.'); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/I9SiV
function name:  (null)
number of ops:  16
compiled vars:  !0 = $assertions, !1 = $assert, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   34     1      > FE_RESET_R                                       $4      !0, ->14
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->14
          3    >   ASSIGN                                                   !2, ~5
   35     4        INIT_FCALL                                               'countfingerpingpong'
          5        SEND_VAR                                                 !2
          6        DO_FCALL                                      0  $7      
          7        IS_NOT_IDENTICAL                                         !1, $7
          8      > JMPZ                                                     ~8, ->13
   36     9    >   NEW                                              $9      'Exception'
         10        SEND_VAL_EX                                              'Assesstions+failed.'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $9
   34    13    > > JMP                                                      ->2
         14    >   FE_FREE                                                  $4
   38    15      > RETURN                                                   1

Function countfingerpingpong:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I9SiV
function name:  countFingerPingPong
number of ops:  15
compiled vars:  !0 = $count, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        INIT_FCALL                                               'abs'
          2        INIT_FCALL                                               'abs'
          3        SUB                                              ~2      !1, 5
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        MOD                                              ~4      $3, 8
          7        SUB                                              ~5      ~4, 4
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                         $6      
         10        ADD                                              ~7      $6, 1
         11        VERIFY_RETURN_TYPE                                       ~7
         12      > RETURN                                                   ~7
   32    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null

End of function countfingerpingpong

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.85 ms | 1403 KiB | 16 Q