3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2FJ7gnO%3A16%240

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

End of function __construct

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

End of function hello

Function echo_hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J7gnO
function name:  echo_hello
number of ops:  8
compiled vars:  !0 = $_this, !1 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_THIS                                       ~2      
          1        ASSIGN                                                   !0, ~2
   16     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJ7gnO%3A16%240'
          3        BIND_LEXICAL                                             ~4, !0
          4        ASSIGN                                                   !1, ~4
   20     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0          
   21     7      > RETURN                                                   null

End of function echo_hello

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.86 ms | 1399 KiB | 13 Q