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) { if ($x < 10) { $test2(); $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/vnION
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'c'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FvnION%3A9%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/vnION
function name:  {closure}
number of ops:  11
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        IS_SMALLER                                               !0, 10
          3      > JMPZ                                                     ~2, ->10
   11     4    >   INIT_DYNAMIC_CALL                                        !1
          5        DO_FCALL                                      0          
   12     6        FETCH_THIS                                       $4      
          7        INIT_METHOD_CALL                                         $4, 'test'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   14    10    > > RETURN                                                   null

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

Class c:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vnION
function name:  test
number of ops:  10
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%2FvnION%3A9%240'
          2        BIND_LEXICAL                                             ~2, !1
          3        ASSIGN                                                   !1, ~2
   15     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   17     7        POST_INC                                         ~5      !0
          8      > RETURN                                                   ~5
   18     9*     > RETURN                                                   null

End of function test

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.59 ms | 1395 KiB | 13 Q