3v4l.org

run code in 300+ PHP versions simultaneously
<?php function betweenScope($num, $min, $max) { $num = ($num > $max) ? $max : ((!$num < $min) ?: $min); } echo betweenScope(21, 0, 5); echo betweenScope(3, 0, 5); echo betweenScope(-10, 0, 5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IMf2Q
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'betweenscope'
          1        SEND_VAL                                                 21
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 5
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
   10     6        INIT_FCALL                                               'betweenscope'
          7        SEND_VAL                                                 3
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 5
         10        DO_FCALL                                      0  $1      
         11        ECHO                                                     $1
   11    12        INIT_FCALL                                               'betweenscope'
         13        SEND_VAL                                                 -10
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 5
         16        DO_FCALL                                      0  $2      
         17        ECHO                                                     $2
         18      > RETURN                                                   1

Function betweenscope:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IMf2Q
function name:  betweenScope
number of ops:  14
compiled vars:  !0 = $num, !1 = $min, !2 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    6     3        IS_SMALLER                                               !2, !0
          4      > JMPZ                                                     ~3, ->7
          5    >   QM_ASSIGN                                        ~4      !2
          6      > JMP                                                      ->12
          7    >   BOOL_NOT                                         ~5      !0
          8        IS_SMALLER                                       ~6      ~5, !1
          9        JMP_SET                                          ~7      ~6, ->11
         10        QM_ASSIGN                                        ~7      !1
         11        QM_ASSIGN                                        ~4      ~7
         12    >   ASSIGN                                                   !0, ~4
    7    13      > RETURN                                                   null

End of function betweenscope

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.33 ms | 1403 KiB | 16 Q