3v4l.org

run code in 300+ PHP versions simultaneously
<?php function percentToDegrees($percent) { $percent = filter_var($percent, FILTER_VALIDATE_INT, array('options' => array('min_range' => 0, 'max_range' => 100))); if ($percent === false) { return false; } return round(($percent / 100) * 180); } var_dump(percentToDegrees(0)); var_dump(percentToDegrees(25)); var_dump(percentToDegrees(50)); var_dump(percentToDegrees(75)); var_dump(percentToDegrees(100));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5k1X2
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'percenttodegrees'
          2        SEND_VAL                                                 0
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   14     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'percenttodegrees'
          8        SEND_VAL                                                 25
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   15    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'percenttodegrees'
         14        SEND_VAL                                                 50
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   16    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'percenttodegrees'
         20        SEND_VAL                                                 75
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                                 
   17    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'percenttodegrees'
         26        SEND_VAL                                                 100
         27        DO_FCALL                                      0  $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function percenttodegrees:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5k1X2
function name:  percentToDegrees
number of ops:  17
compiled vars:  !0 = $percent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 257
          4        SEND_VAL                                                 <array>
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
    6     7        TYPE_CHECK                                    4          !0
          8      > JMPZ                                                     ~3, ->10
    7     9    > > RETURN                                                   <false>
   10    10    >   INIT_FCALL                                               'round'
         11        DIV                                              ~4      !0, 100
         12        MUL                                              ~5      ~4, 180
         13        SEND_VAL                                                 ~5
         14        DO_ICALL                                         $6      
         15      > RETURN                                                   $6
   11    16*     > RETURN                                                   null

End of function percenttodegrees

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.94 ms | 1402 KiB | 24 Q