3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private function privateMethod() { return 'caught'; } }; $c = function() { return $this->privateMethod(); }; $obj = new Test; $c = $c->bindTo($obj, $obj); $c();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S9QOA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $c, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FS9QOA%3A11%240'
          1        ASSIGN                                                   !0, ~2
   16     2        NEW                                              $4      'Test'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   17     5        INIT_METHOD_CALL                                         !0, 'bindTo'
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !0, $7
   18    10        INIT_DYNAMIC_CALL                                        !0
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FS9QOA%3A11%240

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

End of function privatemethod

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.43 ms | 1398 KiB | 13 Q