3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert($input) { $oldMin = 0; $oldMax = 1; $newMin = 127; $newMax = 0; return ceil(((($input- $oldMin) * ($newMax - $newMin)) / ($oldMax - $oldMin)) + $newMin); } 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/WuIUW
function name:  (null)
number of ops:  13
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     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
   14     7    >   INIT_FCALL                                               'convert'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   13    10      > JMP                                                      ->6
         11    >   FE_FREE                                                  $2
   15    12      > RETURN                                                   1

Function convert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WuIUW
function name:  convert
number of ops:  16
compiled vars:  !0 = $input, !1 = $oldMin, !2 = $oldMax, !3 = $newMin, !4 = $newMax
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, 0
    6     2        ASSIGN                                                   !2, 1
    7     3        ASSIGN                                                   !3, 127
    8     4        ASSIGN                                                   !4, 0
   10     5        INIT_FCALL                                               'ceil'
          6        SUB                                              ~9      !0, !1
          7        SUB                                              ~10     !4, !3
          8        MUL                                              ~11     ~9, ~10
          9        SUB                                              ~12     !2, !1
         10        DIV                                              ~13     ~11, ~12
         11        ADD                                              ~14     ~13, !3
         12        SEND_VAL                                                 ~14
         13        DO_ICALL                                         $15     
         14      > RETURN                                                   $15
   11    15*     > RETURN                                                   null

End of function convert

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.36 ms | 1399 KiB | 18 Q