3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function __construct($b) { $this->b = $b; } private function aa() { echo 'a::aa'; } public function b() { $that = $this; $this->b->f(function() use ($that) { $that->aa(); }); } } class b { public function f($f) { $f(); } } $a = new a(new b); $a->b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj0kT
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'a'
          1        NEW                                              $2      'b'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   25     6        INIT_METHOD_CALL                                         !0, 'b'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKj0kT%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj0kT
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $that
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   BIND_STATIC                                              !0
          1        INIT_METHOD_CALL                                         !0, 'aa'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKj0kT%3A14%240

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj0kT
function name:  __construct
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'b'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

Function aa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj0kT
function name:  aa
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'a%3A%3Aaa'
   10     1      > RETURN                                                   null

End of function aa

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj0kT
function name:  b
number of ops:  9
compiled vars:  !0 = $that
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN                                                   !0, ~1
   14     2        FETCH_OBJ_R                                      ~3      'b'
          3        INIT_METHOD_CALL                                         ~3, 'f'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKj0kT%3A14%240'
          5        BIND_LEXICAL                                             ~4, !0
          6        SEND_VAL_EX                                              ~4
          7        DO_FCALL                                      0          
   15     8      > RETURN                                                   null

End of function b

End of class a.

Class b:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj0kT
function name:  f
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   21     3      > RETURN                                                   null

End of function f

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.78 ms | 1399 KiB | 13 Q