3v4l.org

run code in 300+ PHP versions simultaneously
<?php $l = array_fill(0, 25, ''); function clamp($n) { return ($n > 3) ? 3 : $n; } foreach($l as $i=>$b) { echo $i . ' => ' . clamp($i) . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/CfeWO
function name:  (null)
number of ops:  19
compiled vars:  !0 = $l, !1 = $b, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 25
          3        SEND_VAL                                                 ''
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
   10     6      > FE_RESET_R                                       $5      !0, ->17
          7    > > FE_FETCH_R                                       ~6      $5, !1, ->17
          8    >   ASSIGN                                                   !2, ~6
   12     9        CONCAT                                           ~8      !2, '+%3D%3E+'
         10        INIT_FCALL                                               'clamp'
         11        SEND_VAR                                                 !2
         12        DO_FCALL                                      0  $9      
         13        CONCAT                                           ~10     ~8, $9
         14        CONCAT                                           ~11     ~10, '%0A'
         15        ECHO                                                     ~11
   10    16      > JMP                                                      ->7
         17    >   FE_FREE                                                  $5
   13    18      > RETURN                                                   1

Function clamp:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CfeWO
function name:  clamp
number of ops:  8
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        IS_SMALLER                                               3, !0
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      3
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~2      !0
          6    > > RETURN                                                   ~2
    8     7*     > RETURN                                                   null

End of function clamp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.75 ms | 1399 KiB | 16 Q