3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { private $private_property = 'wut?'; public function callClosure() { $closure = $this->getClosure(); $closure(); } protected function getClosure() { return function() { echo $this->private_property; }; } } $obj = new MyClass; $obj->callClosure();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E7mGv
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'callClosure'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FE7mGv%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E7mGv
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'private_property'
          2        ECHO                                                     ~1
   17     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FE7mGv%3A15%240

Class MyClass:
Function callclosure:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E7mGv
function name:  callClosure
number of ops:  6
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_METHOD_CALL                                         'getClosure'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   10     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   11     5      > RETURN                                                   null

End of function callclosure

Function getclosure:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E7mGv
function name:  getClosure
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FE7mGv%3A15%240'
   17     1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getclosure

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.18 ms | 1386 KiB | 13 Q