3v4l.org

run code in 300+ PHP versions simultaneously
<?php function the_mvc_while(callable $condition, callable $body) { while ($condition()) $body(); } $i = 0; $count = 10; $condition = function() use (&$i, $count) { $i++; return $i < $count; }; $body = function() use ($i) { echo $i."\n"; }; the_mvc_while($condition, $body);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YWCkL
function name:  (null)
number of ops:  14
compiled vars:  !0 = $i, !1 = $count, !2 = $condition, !3 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
    5     1        ASSIGN                                                   !1, 10
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYWCkL%3A6%240'
          3        BIND_LEXICAL                                             ~6, !0
          4        BIND_LEXICAL                                             ~6, !1
          5        ASSIGN                                                   !2, ~6
    7     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYWCkL%3A7%241'
          7        BIND_LEXICAL                                             ~8, !0
          8        ASSIGN                                                   !3, ~8
    8     9        INIT_FCALL                                               'the_mvc_while'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !3
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function the_mvc_while:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/YWCkL
function name:  the_mvc_while
number of ops:  9
compiled vars:  !0 = $condition, !1 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > JMP                                                      ->5
          3    >   INIT_DYNAMIC_CALL                                        !1
          4        DO_FCALL                                      0          
          5    >   INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0  $3      
          7      > JMPNZ                                                    $3, ->3
          8    > > RETURN                                                   null

End of function the_mvc_while

Function %00%7Bclosure%7D%2Fin%2FYWCkL%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YWCkL
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $i, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
          2        PRE_INC                                                  !0
          3        IS_SMALLER                                       ~3      !0, !1
          4      > RETURN                                                   ~3
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYWCkL%3A6%240

Function %00%7Bclosure%7D%2Fin%2FYWCkL%3A7%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YWCkL
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
          1        CONCAT                                           ~1      !0, '%0A'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYWCkL%3A7%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.25 ms | 1403 KiB | 14 Q