3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($compatibility) { return min(28, intval(round(28 * $compatiblity))); } foreach (array(0, 0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5) as $compatibility) { var_dump(foo($compatibility)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 9
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/a8Ov7
function name:  (null)
number of ops:  11
compiled vars:  !0 = $compatibility
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > FE_RESET_R                                       $1      <array>, ->9
          1    > > FE_FETCH_R                                               $1, !0, ->9
    9     2    >   INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'foo'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
    8     8      > JMP                                                      ->1
          9    >   FE_FREE                                                  $1
   10    10      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a8Ov7
function name:  foo
number of ops:  12
compiled vars:  !0 = $compatibility, !1 = $compatiblity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'min'
          2        SEND_VAL                                                 28
          3        INIT_FCALL                                               'round'
          4        MUL                                              ~2      !1, 28
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        CAST                                          4  ~4      $3
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10      > RETURN                                                   $5
    5    11*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.25 ms | 1398 KiB | 20 Q