3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { public function __construct() { $self = &$this; $func = function () use (&$self) { $self->test(); }; $func(); } private function test(){ echo 'test';} } new x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gs18v
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $0      'x'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FGs18v%3A8%240

Class x:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gs18v
function name:  __construct
number of ops:  8
compiled vars:  !0 = $self, !1 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       $2      
          1        ASSIGN_REF                                               !0, $2
    8     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGs18v%3A8%240'
          3        BIND_LEXICAL                                             ~4, !0
          4        ASSIGN                                                   !1, ~4
   11     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0          
   12     7      > RETURN                                                   null

End of function __construct

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

End of function test

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.56 ms | 1395 KiB | 13 Q