3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { /** * @param integer $i * @return mixed */ public function test($i) { $self = $this; $test2 = function($x) use(&$test2, &$self) { var_dump($x); $x++; if ($x < 10) { $test2($x); $self->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/Smq94
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'c'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FSmq94%3A10%240

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

End of function test

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.5 ms | 1400 KiB | 15 Q