3v4l.org

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

Function betweenscope:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gX9GP
function name:  betweenScope
number of ops:  17
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      
    7     3        IS_SMALLER                                               !2, !0
          4      > JMPZ                                                     ~3, ->8
    9     5    >   ECHO                                                     'a'
   10     6      > RETURN                                                   !0
          7*       JMP                                                      ->16
   13     8    >   BOOL_NOT                                         ~4      !0
          9        IS_SMALLER                                               ~4, !1
         10      > JMPZ                                                     ~5, ->14
   15    11    >   ECHO                                                     'b'
   16    12      > RETURN                                                   !0
         13*       JMP                                                      ->16
   19    14    >   ECHO                                                     'c'
   20    15      > RETURN                                                   !1
   23    16*     > RETURN                                                   null

End of function betweenscope

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1403 KiB | 16 Q