3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert($input) { $range_input = range(1, 0, 1/127); $range_output = range(0, 127); foreach ($range_input as $key => $value) { if ($value <= $input) { return $range_output[$key]; } } return 127; } foreach(range(0,1,1/1000) as $input) { convert($input); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/tm3KM
function name:  (null)
number of ops:  13
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 0.001
          4        DO_ICALL                                         $1      
          5      > FE_RESET_R                                       $2      $1, ->11
          6    > > FE_FETCH_R                                               $2, !0, ->11
   18     7    >   INIT_FCALL                                               'convert'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   17    10      > JMP                                                      ->6
         11    >   FE_FREE                                                  $2
   19    12      > RETURN                                                   1

Function convert:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/tm3KM
function name:  convert
number of ops:  24
compiled vars:  !0 = $input, !1 = $range_input, !2 = $range_output, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 0.00787402
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    6     7        INIT_FCALL                                               'range'
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 127
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
    8    12      > FE_RESET_R                                       $9      !1, ->21
         13    > > FE_FETCH_R                                       ~10     $9, !3, ->21
         14    >   ASSIGN                                                   !4, ~10
    9    15        IS_SMALLER_OR_EQUAL                                      !3, !0
         16      > JMPZ                                                     ~12, ->20
   10    17    >   FETCH_DIM_R                                      ~13     !2, !4
         18        FE_FREE                                                  $9
         19      > RETURN                                                   ~13
    8    20    > > JMP                                                      ->13
         21    >   FE_FREE                                                  $9
   14    22      > RETURN                                                   127
   15    23*     > RETURN                                                   null

End of function convert

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.73 ms | 1394 KiB | 16 Q