3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { /** * @param integer $i * @return mixed */ public function test($i) { $test2 = function($x) use(&$test2) { $x++; if ($x < 10) { $test2($x); $this->test($x); } }; $test2($i); return $i; } } $t = new c(); $t->test(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWgeP
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'c'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuWgeP%3A9%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/uWgeP
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $x, !1 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   10     2        PRE_INC                                                  !0
   11     3        IS_SMALLER                                               !0, 10
          4      > JMPZ                                                     ~3, ->12
   12     5    >   INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   13     8        FETCH_THIS                                       $5      
          9        INIT_METHOD_CALL                                         $5, 'test'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   15    12    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuWgeP%3A9%240

Class c:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWgeP
function name:  test
number of ops:  9
compiled vars:  !0 = $i, !1 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuWgeP%3A9%240'
          2        BIND_LEXICAL                                             ~2, !1
          3        ASSIGN                                                   !1, ~2
   16     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   18     7      > RETURN                                                   !0
   19     8*     > RETURN                                                   null

End of function test

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.03 ms | 1399 KiB | 13 Q